Closed Bug 170455 Opened 22 years ago Closed 21 years ago

eracom-tech.com - Unescaped "</script>" in a document.write - page does not render or continue loading

Categories

(Tech Evangelism Graveyard :: English US, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: bugzilla2, Unassigned)

References

()

Details

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.2b) Gecko/20020923 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.2b) Gecko/20020923 go to http://www.eracom-tech.com the pages says it is loading .... but never does anything else In IE the page does actually finish loading Reproducible: Always Steps to Reproduce: 1.go to http://www.eracom-tech.com 2. 3.
Netscape 4.79 also works This could be the javascript?
Status: UNCONFIRMED → NEW
Ever confirmed: true
The JavaScript Console gives this error: Error: unterminated string literal Source File: http://195.4.119.215/menuframe.asp?ln=2 Line: 31, Column: 17 Source Code: sp;training','../index.asp?ln=2&tt=1&c=707',1,0,0],['&nbsp;&nbsp;jobs', '../index.asp?ln=2&tt=1&c=330',1,0,0]]; Changing component to JavaScript Engine, but might be en Evangelism bug.
Assignee: asa → rogerl
Component: Browser-General → JavaScript Engine
QA Contact: asa → pschwartau
Yes, it looks like the site has made a coding error here. This is the script block where the error occurs: <script language="JavaScript"> scripte1 = "<"+"script language=javaScript>HM_Array1 = [[200,132,112,'#556688','#000000 ','#EBF9FE','#FF9802','#556688','#556688',0,0,0,1,1,1,'null','null',],['&nbsp;&n etc. etc. t=1&c=465',1,0,0],['&nbsp;&nbsp;training','../index.asp?ln=2&tt=1&c=707',1,0,0], ['&nbsp;&nbsp;jobs','../index.asp?ln=2&tt=1&c=330',1,0,0]];</script>"; myQueryString = "ln=2"; parent.FCONTENT.window.location.href="index.asp?"+myQueryString; </script> HTML authors have to be careful whenever they use document.write() inside a <script> block in order to create another <script> block. They have to remember that the HTML parser sees all this before the JS parser does. So above, notice the authors were careful to "hide" the opening <script> tag as it is document.written(): scripte1 = "<" + "script language=javaScript> etc. etc. But they FORGOT to hide the end-script tag: x.asp?ln=2&tt=1&c=330',1,0,0]];</script>"; Therefore what the HTML parser sees is this: <script> scripte1 = "<"+"script language=javaScript>HM_Array1 = etc. etc. etc. etc. x.asp?ln=2&tt=1&c=330',1,0,0]];</script> This makes an unterminated string literal just before the </script> tag, hence the error: Error: unterminated string literal Source Code: etc. etc. /index.asp?ln=2&tt=1&c=330',1,0,0]]; The HTML parser does NOT continue to the next </script> block and back-track to this one and see that it it part of a string literal. It stops the first <script> parse at the first </script> tag it sees. That is why the end-script tag must be hidden in the document.write(), just like the opening-script tag was. Reassigning to HTML Parser component. This could be marked as a duplicate of bug 175375, "Unescaped "</script>" in a document.write" (marked INVALID) But I do not know how we might differ on this from IE, which may be a valid question; I don't know the spec for HTML Parser -
Assignee: rogerl → harishd
Component: JavaScript Engine → Parser
QA Contact: pschwartau → moied
Summary: page does not render or continue loading → Unescaped "</script>" in a document.write - page does not render or continue loading
--> bclary
Assignee: harishd → bclary
Component: Parser → African
Product: Browser → Tech Evangelism
Version: Trunk → unspecified
Component: African → US General
Summary: Unescaped "</script>" in a document.write - page does not render or continue loading → eracom-tech.com - Unescaped "</script>" in a document.write - page does not render or continue loading
tech evang june 2003 reorg
Assignee: bc → english-us
QA Contact: moied → english-us
site has redesigned, and has been fixed.
Status: NEW → RESOLVED
Closed: 21 years ago
OS: Windows XP → All
Hardware: PC → All
Resolution: --- → FIXED
Product: Tech Evangelism → Tech Evangelism Graveyard
You need to log in before you can comment on or make changes to this bug.