Closed Bug 33055 Opened 24 years ago Closed 24 years ago

JavaScript does not execute properly

Categories

(Core :: DOM: HTML Parser, defect, P3)

x86
Windows NT
defect

Tracking

()

VERIFIED WORKSFORME

People

(Reporter: amasri, Assigned: harishd)

References

()

Details

with Netscape6 beta1 2000032306:

1. Load page http://investorworld.de/

Result: In the lower right corner, bare text appears instead of executing a 
script. Script follows:
 <!--
    var adj = "<script language='javascript'    
src='http://ad.de.doubleclick.net/adj/www.investornet.de/hpunten;sz=468x60;tile=
1;ord=456789?'></XMP><PRE><B>&lt;<FONT SIZE=+0 
COLOR="#551A8B">/script</FONT>&gt;</B>";
                                if(navigator.appName != "Microsoft Internet 
Explorer")
                                {
                                        document.writeln(adj);
                                }
                        // -->
There's a string literal that contains /script (no angle brackets), the parser 
is chopping off the string literal at that point and passing it to the engine. 
The rest of script is then displayed.
Assignee: rogerl → rickg
Component: Javascript Engine → Parser
QA Contact: rginda → janc
One for my spiritual advisor.
Assignee: rickg → harishd
OK, on further investigation the page actually seems to contain a slew of JS 
errors - not the least is that the string contains un-escaped " " around the 
color specification.
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → INVALID
Thank you for your comments. This page belongs to one of our clients.
Status: RESOLVED → VERIFIED
Group: netscapeconfidential?
*** Bug 35595 has been marked as a duplicate of this bug. ***
investorworld undergoing major re-haul.  Expect this entire page might be 
replaced.  Let's watch it.  Expect change week of April 17th.
Kai-Uwe Beecken, investorworld, added to cc-list

Marked Not "Netscape Confidential"
Group: netscapeconfidential?
Reopening because this issue still exists.
Status: VERIFIED → REOPENED
Resolution: INVALID → ---
I just went bact to the site (4/23 NT debug build) and everything is drawing 
fine now - no JS code in bottom right. What build version has the bug still been  
seen on?
Yup, I don't see the problem either.
We found that Netscape 6 has a problem with our JavaScript. 
Our script contains:

...
var adj = "</script>";
document.writeln(adj);
...

Netscape interprets the variable definition as the end of the script. 

We can fix that problem on our side by writing:

...
var adj = "</";
adj +="script>";
document.writeln(adj);
...

We did that on some places already, I found that somewhere in our
site it will still show up. 

I think it would be better to fix that on your side, our script is 
probably not the only one that works like that. 
Mozilla does handle malformed CDATA content. Here is an example - modified from 
the original URL.

<!doctype html public "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<body>

 <script language="javascript">
  <!--
   var adj = "<script language='javascript' src='something.js'>";
   adj+="</script>"
   if(document.layers)
   {
     document.writeln(adj);
   }
   document.write("</script>");
   document.write("Some text");
  // -->
</script>
</body>
</html>

And here is the content-model ( The way mozilla interpreted )-

docshell=01618D70
html@0302CCB8 refcount=3<
  head@0302CC58 refcount=2<
  >
  Text@030744C0 refcount=3<\n>
  body@03074408 refcount=3<
    Text@030B2400 refcount=3<\n\n >
    script@030B2388 language=javascript refcount=2<
      Text@030B7500 refcount=2<\r\n  <!--\r\n   var adj = "<script 
language='javascript' src='something.js'>";\r\n   adj+="</script>"\r\n   
if(document.layers)\r\n   {\r\n     document.writeln(adj);\r
\n   }\r\n   document.write("</script>");\r\n   document.write("Some text");\r\n  
// -->\r\n>
    >
    Text@03266B70 refcount=3<Some text\n>
  >
>


Note: The illegal </SCRIPT> ( couple of 'em ) did not pose any problem.

If you load the example you should see "Some text". If you see any other extra 
stuff then you are probably using a very old build.
Marking as WORKSFORME.
Status: REOPENED → RESOLVED
Closed: 24 years ago24 years ago
Resolution: --- → WORKSFORME
Verified as working in ns6 2000030508
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.