Forum Moderators: open

Message Too Old, No Replies

IE Javascript error

How to read the lines

         

coldrain

1:08 pm on Apr 24, 2007 (gmt 0)

10+ Year Member



hi all,

i am developing my site, and i have got some JS errors, shown in IE.

For example:

Line:18
Char:3
Code:0
Error:'null' is null or not an object

My question is: HOW TO COUNT THIS LINE AND CHAR?

Should I count only code line (not the empty ones) or I should include empty lines in counting also? Same about chars?...

Thx :)

Dabrowski

5:24 pm on Apr 24, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hmmm, I believe if it's an external JS file, it's from the very top of the file, and if it's in a <script> tag I think it's from the line after <script>.

Both include blank lines.

What I do sometimes if I can't find it, put on a new line some rubbish text, fjdsilfdjfkjfjfkjfkjfkfkdfdsl, and it will complain about that being an error, and give a line number.

rocknbil

6:49 pm on Apr 24, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome aboard coldrain!

The line count is seldom accurate. A better way to go about it is to check it out in FireFox and use the Javascript console, it will point to the specific line and piece of code that's choking.

"null" is not an object can mean you are referencing a document object, function, or other object that doesn't exist. Sometimes it's as simple as a broken piece of HTML code in the document itself.

Dabrowski

7:09 pm on Apr 24, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The line count is seldom accurate

Wrong. The line count is accurate, at least with an external JS file. If it's inline script then I don't know whether it points to the entire file, or just that bit of script.