Forum Moderators: open

Message Too Old, No Replies

Help with Java Script Error please

         

DannyP43

8:27 pm on Sep 20, 2006 (gmt 0)

10+ Year Member



I have been getting the following error message,

unterminated string constant
source:http://www.example.com/contact1.html
Line:12

I have copied the html code from line 12 below, any advice as to what is causing the error would be grately appreciated.

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

[edited by: jatar_k at 11:15 pm (utc) on Sep. 21, 2006]
[edit reason] examplified [/edit]

penders

10:24 pm on Sep 20, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



A JavaScript error? There is no error in the HTML you have posted. To get at Line#12 try skipping over blank lines and comments in the source perhaps?

-----

But the error that's given is a bit strange - it doesn't look like a 'normal' javascript error?! Almost like it's generated by the code itself?! IE is not reporting it in the usual way (with the debugger) and FF does not report it all?!

Would need to see more code...

rocknbil

5:59 am on Sep 21, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome aboard Danny, as you may have already guessed, "line 12" in a view-source or even pasted into an editor has nothing to do with IE's idea of "line 12."

Penders is correct, if you want to see specifically where the error is, load the page in FireFox then view the Javascript Console, it will point right to it.

An unterminated string constant is usually the sign of a missing quote.

var msg = 'Hello World'; // ' and ' start and end the string constant

var msg = 'Hello World; // oops