By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,442 Members | 1,358 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,442 IT Pros & Developers. It's quick & easy.

Javascript error reporting for IE

P: n/a
I have written some Javascript that works perfectly in Firefox - no
errors reported. The dreaded MSIE 6 produces nothing but a long line
of 'undefinedundefinedundefinedundefinedundefined ....'
Each 'undefined' represents a text node or element I have interted
into the DOM. As far as I can see I have declared all variables and
asigned values so I just can't see what is wrong.
Unfortunately the error reporting in MSIE is very poor indeed. The
line number it reports , for the 'error', is not of any use because
I have my javascripts in separate file to the html.

IE is such a crappy browser compared to Firefox but, as so many people
use it, I have to spend time sorting this out.

Is there any free software available that will give me a more detailed
report of why MSIE 6 is complaining?
Remove 'no_spam_' from email address.
Skype Free Zone!!
Oct 5 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Long live Firefox...

Here's something you may find interesting for your torturous time with
IE.

http://blogs.msdn.com/ie/archive/2004/10/26/247912.aspx

On Oct 5, 4:40 pm, Brian A <no_spam_bca1...@hotmail.comwrote:
I have written some Javascript that works perfectly in Firefox - no
errors reported. The dreaded MSIE 6 produces nothing but a long line
of 'undefinedundefinedundefinedundefinedundefined ....'
Each 'undefined' represents a text node or element I have interted
into the DOM. As far as I can see I have declared all variables and
asigned values so I just can't see what is wrong.
Unfortunately the error reporting in MSIE is very poor indeed. The
line number it reports , for the 'error', is not of any use because
I have my javascripts in separate file to the html.

IE is such a crappy browser compared to Firefox but, as so many people
use it, I have to spend time sorting this out.

Is there any free software available that will give me a more detailed
report of why MSIE 6 is complaining?
Remove 'no_spam_' from email address.
Skype Free Zone!!
Oct 5 '06 #2

P: n/a

Brian A wrote:
I have written some Javascript that works perfectly in Firefox - no
errors reported. The dreaded MSIE 6 produces nothing but a long line
of 'undefinedundefinedundefinedundefinedundefined ....'
The usual strategy is to test frequently after every small change.
Don't do 500 lines of code only testing in Firefox then swap to IE - it
just won't work, particularly if you are doing DOM stuff with new code
rather than libraries[1] of tested, cross-platform functions.
Each 'undefined' represents a text node or element I have interted
into the DOM. As far as I can see I have declared all variables and
asigned values so I just can't see what is wrong.
Quite likely you have a single error that is being propagated - post a
minimal example (or link) that shows the error and maybe you'll get
some help.
Unfortunately the error reporting in MSIE is very poor indeed. The
line number it reports , for the 'error', is not of any use because
I have my javascripts in separate file to the html.
Insert an alert at a place that is before where you think the error is.
Move it down the code until it fails, then you know where to start. It
will also give you a key to knowing how the line numbering works - it
actually makes sense once you work it out.

[...]

1. By "libraries" I don't mean things like prototype.js or dojo, but
tried and tested functions that you've compiled into a small utility
library, perhaps on a per project basis.
--
Rob

Oct 6 '06 #3

P: n/a
On 5 Oct 2006 18:25:49 -0700, "RobG" <rg***@iinet.net.auwrote:
>
Brian A wrote:
>I have written some Javascript that works perfectly in Firefox - no
errors reported. The dreaded MSIE 6 produces nothing but a long line
of 'undefinedundefinedundefinedundefinedundefined ....'

The usual strategy is to test frequently after every small change.
Don't do 500 lines of code only testing in Firefox then swap to IE - it
just won't work, particularly if you are doing DOM stuff with new code
rather than libraries[1] of tested, cross-platform functions.
>Each 'undefined' represents a text node or element I have interted
into the DOM. As far as I can see I have declared all variables and
asigned values so I just can't see what is wrong.

Quite likely you have a single error that is being propagated - post a
minimal example (or link) that shows the error and maybe you'll get
some help.
>Unfortunately the error reporting in MSIE is very poor indeed. The
line number it reports , for the 'error', is not of any use because
I have my javascripts in separate file to the html.

Insert an alert at a place that is before where you think the error is.
Move it down the code until it fails, then you know where to start. It
will also give you a key to knowing how the line numbering works - it
actually makes sense once you work it out.

[...]

1. By "libraries" I don't mean things like prototype.js or dojo, but
tried and tested functions that you've compiled into a small utility
library, perhaps on a per project basis.
Thanks to people who posted a reply.
I have sussed out what was wrong with my script. For the benefit of
those reading this post I am reporting details of the error.
I am operating an AJAX regime. I had previously sent raw server data
to the DOM and all had been OK except the formatting wasn't good. I
introduced a few style sheet changes and that fixed it for Firefox but
not IE. Doing things to fix a script, depending on the browser type,
is a bad way of doing things anyway. I set out to write code to format
the data in the DOM so that, hopefully, it would then display OK in
all browsers.
The mistake I made was I treated the incoming data as an array.
Firefox was happy with that but, IE, absolutely correctly, rejected
it. After converting the raw data into an array, before formatting, my
code now works perfectly. So, it wasn't the existing code that was at
fault but the omission of one line of code.
Remove 'no_spam_' from email address.
Skype Free Zone!!
Oct 6 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.