Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Javascript in IE - ajax dies!
Old 02-21-2007, 12:17 AM Javascript in IE - ajax dies!
Junior Talker

Posts: 3
Trades: 0
I have an Ajax app which works fine in firefox but dies in IE.

The code below shows what happens after the request returns a result which is a series of comma separated strings:
...
results = http.responseText.split(",");
id=results[0];
stat=results[1];
comment=results[2];
...

IE says "Object does not support property or method" and the debugger points me to the line:
stat=results[1];

but this does not make sense to me... what property or method? Does the debugger aleways point to the right line, or should I be looking elsewhere?
dr_snapid is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-21-2007, 02:19 AM Re: Javascript in IE - ajax dies!
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
Quite often, the problem is the line above it.

Is HTTP being created correctly as an IE object? Does it have a value for responseText when it comes out?

alert() is your friend in this case. Use it to try and track your output.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 02-21-2007, 05:18 PM Re: Javascript in IE - ajax dies!
Junior Talker

Posts: 3
Trades: 0
That's all great advice ADAM. Yes http is being created OK, and the response is valid. The line above is also a no-brainer which shouldnt throw that message. The error message might make sense if the error was the line with split(), especially if responseText was empty maybe, but I had already checked using alert() and found the same string as firefox sees.


Seems to affect all versions of IE though... FF is happy.

Last edited by dr_snapid; 02-21-2007 at 05:19 PM..
dr_snapid is offline
Reply With Quote
View Public Profile
 
Old 02-22-2007, 05:43 PM Re: Javascript in IE - ajax dies!
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
Okay. This is going to sound like a waste of time, and really stupid, but sometimes things like this work.

Try gathering the responseText into one variable, and splitting it using another variable on a separate line. It may be the combination of the two that IE has the problem with.

Sorry dude...I can't think of anything else, unless perhaps you've got a sample page you can show us. Maybe we can deconstruct, reconstruct, and find the answer that way.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 02-22-2007, 07:30 PM Re: Javascript in IE - ajax dies!
Junior Talker

Posts: 3
Trades: 0
well i found it. thanks for your help adam.

The problem was the use of the word 'stat' as a variable!

It must be some kind of reserved word in IE.
dr_snapid is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Javascript in IE - ajax dies!
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.22295 seconds with 12 queries