473,387 Members | 1,611 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Javascript error reporting for IE

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
3 2283
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

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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.