I'm having trouble with the following code: -
<SCRIPT>
-
<!--
-
if (navigator.appName == 'Microsoft Internet Explorer') {
-
document.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"templates/94076/menu.css\" media=\"screen, print\" />");
-
document.write("<script src=\"templates/94076/menu.js\" language=\"javascript\" type=\"text/javascript\"></script>");
-
} else {
-
document.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"templates/94076/menu-ns.css\" media=\"screen, print\" />");
-
}
-
//-->
-
</SCRIPT>
-
For some reason in FireFox, the "</script>" in the string on the 5th line is being seen and the end of the first <script>, and not as part of the string. So firefox is displaying: -
"); } else { document.write(""); } //-->
-
at the top of the page. IE7 seems to handle it ok. My main problem here is that I have no control over this code, it is added to the code by a ecommerce site. So I have no idea what to do about it. Does any one have any ideas why FireFox is seeing this incorrectly? Any suggestions about how I may go about fixing this? This is for this site, but I have to keep it reverted to the old working version so this will only show up while I'm working on it during the day.
Any help will be greatly appreciated.
7 4278 Markus 6,050
Recognized Expert Expert
Sigh.
Where have you learned this?
Get with the times, you have to specify a type attribute to the script element, which, might I add, should be lower-case as should all element names.
Mark.
As I said, I have no control over this code, it is inserted by the e-commerce site into the template I'm designing. I'm well aware that the code sucks, but I can't do anything about it.
You are using xhtml end tags, />, but declaring html. Remove the slashes. Sometimes browsers will stop processing at that point.
Firefox has no issues with <script>
acoder 16,027
Recognized Expert Moderator MVP
You'll need to escape or expand the end script tag, e,g. - document.write("<script src=\"templates/94076/menu.js\" type=\"text/javascript\"><\/script>");
-
// altenatively
-
document.write("<script src=\"templates/94076/menu.js\" type=\"text/javascript\"></scr" + "ipt>");
Atli 5,058
Recognized Expert Expert
My main problem here is that I have no control over this code, it is added to the code by a ecommerce site. So I have no idea what to do about it.
Why is a eCommerce site adding stuff to your page?
Can't you just write a proper version of this code and use that in stead of the mess this eCommerce site is giving you?
If there is no other way than to have this mess forced upon you, I can not see how you can fix it.
You would have to contact the people responsible for it and have them fix it.
Why is a eCommerce site adding stuff to your page?
Can't you just write a proper version of this code and use that in stead of the mess this eCommerce site is giving you?
This was just a template that the site uses so the eCommerce page will look the same as the real site. After fighting with it for hours and fixing tons of other bugs and display issues, I did manage to find out that I was using the wrong doctype. The first person to work on this project used Dreamweaver and apparently it guessed wrong. The original template had no doctype, so as soon as I removed it altogether it worked ok. I hate not using one but it works now and I don't care, this project took way too long (they're gonna flip when they see the bill!)
Thanks for all the input.
Atli 5,058
Recognized Expert Expert
Ok. Glad you got it to work.
I should point out tho, if only for future reference, that by leaving out the doctype you aren't really fixing the problem. Firefox simply switches out of standards-compliance mode and into quirks-mode, which is made to allow a certain amount of errors and buggy markup. It won't render you pages correctly in quirks-mode, but if you markup is buggy already, it might *seem* less buggy.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Madhav |
last post by:
I have the following statements in my script.
----------------------------------------------------------
textToWrite = "<HTML> \n" +
"<HEAD> \n" +
"<TITLE>Calendar</TITLE> \n" +
"<SCRIPT LANGUAGE=\"JavaScript1.2\"SRC=\"popWin.js\">"+
"</SCRIPT> \n" +
"</HEAD> \n" +
"<BODY> \n" ;
textToWrite += "<\BODY>\n" +
|
by: Grzegorz ¦lusarek |
last post by:
Hello everyone. I1m writing webb aplication using AJAX (prototype
library: http://prototype.conio.net/ and
scriptacuolous:http://script.aculo.us/).
My Problem is that that I'm doing XMLHttpRequest to server and i get the
piece of HTML code (one div - container). Tha div is change on site and
almost everything is good but the html code hava javascript code between
<script> and </script> and that code is missing. This is weird because
i...
|
by: andrew |
last post by:
So I spent ages trying to work out what the problem was with my code
when I did this and found a post which led me to the very simple
solution.
I use WebMatrix so I'm not sure if this is a major problem in VS or not
but it is bloody frustrating.
Stick the following bit of code into a page and save it.
<%@ Page Language="C#" %>
|
by: hemant.singh |
last post by:
Hello all,
I am try'g to send window.location.href to the server script who will
generate dynamic javascript according to the referral name comg in as
param
Now bcz
<script language="javascript" src="NO JAVASCRIPT CAN BE USED HERE" />
So I am see'g If I can use eval todo something what I am doing
I have tried almost everything, following is being last one
|
by: Iddo |
last post by:
Hi,
I am having a strange problem...
I have an HTML file which has 2 script tags:
1) <script language="javascript" id="ABC" src="ABC.js" />
2) <script id="general" language="javascript">
function foo()
{
alert("aaa");
}
</script>
| |
by: rhythmace |
last post by:
W3C HTML validator passes this:
....
<script type="text/javascript" src="foo.js">
<script type="text/javascript">
....script in here...
</script>
....
|
by: -Karl |
last post by:
Couls someone please advise me on this error. What I am trying to do
is be able to convert an XML document into arrays. I read that the
subs & functions have to be in <scripttags.
Thanks!
Error:
BC30456: 'Read_DOM' is not a member of
|
by: Gretsch |
last post by:
I have a lot of nicely formatted HTML to be displayed for visitors WITHOUT script (/enabled), and a second set of HTML for those WITH script.
The <noscript> tag allows me to separate the HTML for those without script,
How can I separate the HTML for those with script? (ie not run for those without script enabled.
The only way I've found so far is:
...
<noscript>
This should only be diplayed when scripting is not configured
|
by: joe |
last post by:
Is it OK to have multiple:
<script type="text/javascript" src="funcs1.js"></script>
<script type="text/javascript" src="funcs2.js"></script>
<script type="text/javascript" src="funcs3.js"></script>
?
And I need to use similarly multiple CSS:
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |