JavaScript does not execute properly

VERIFIED WORKSFORME

Status

()

Core
HTML: Parser
P3
normal
VERIFIED WORKSFORME
18 years ago
18 years ago

People

(Reporter: Allan Masri, Assigned: harishd)

Tracking

Trunk
x86
Windows NT
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

18 years ago
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);
                                }
                        // -->

Comment 1

18 years ago
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

Comment 2

18 years ago
One for my spiritual advisor.
Assignee: rickg → harishd

Comment 3

18 years ago
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
Last Resolved: 18 years ago
Resolution: --- → INVALID
(Reporter)

Comment 4

18 years ago
Thank you for your comments. This page belongs to one of our clients.
Status: RESOLVED → VERIFIED
(Reporter)

Updated

18 years ago
Group: netscapeconfidential?

Comment 5

18 years ago
*** Bug 35595 has been marked as a duplicate of this bug. ***

Comment 6

18 years ago
investorworld undergoing major re-haul.  Expect this entire page might be 
replaced.  Let's watch it.  Expect change week of April 17th.

Comment 7

18 years ago
Kai-Uwe Beecken, investorworld, added to cc-list

Marked Not "Netscape Confidential"
Group: netscapeconfidential?

Comment 8

18 years ago
Reopening because this issue still exists.
Status: VERIFIED → REOPENED
Resolution: INVALID → ---

Comment 9

18 years ago
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?
(Assignee)

Comment 10

18 years ago
Yup, I don't see the problem either.

Comment 11

18 years ago
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. 
(Assignee)

Comment 12

18 years ago
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.
(Assignee)

Comment 13

18 years ago
Marking as WORKSFORME.
Status: REOPENED → RESOLVED
Last Resolved: 18 years ago18 years ago
Resolution: --- → WORKSFORME
(Reporter)

Comment 14

18 years ago
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.