471,082 Members | 745 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Problem with xmlhttp and mozilla

I request a response with xmlhttp. I'm testing it on mozilla and
explorer. mozilla returns "undefined" unless i "alert" the value of the
response first.
explorer works fine. what is the problem.

Jul 23 '05 #1
2 1197
"xmlhttp" is the ms way to define or start an xml component.

Unless you have ever seen the 'mozilla' way of requesting
or never posted it verbatim, there is little change in hell to
get an affirmative anwser.

In other words : you can not use the same WORD to
have it on either browser the SAME way.

<jw*****@gmail.com> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com...
I request a response with xmlhttp. I'm testing it on mozilla and
explorer. mozilla returns "undefined" unless i "alert" the value of the
response first.
explorer works fine. what is the problem.


Jul 23 '05 #2
jw*****@gmail.com wrote:
I request a response with xmlhttp. I'm testing it on mozilla and
explorer. mozilla returns "undefined" unless i "alert" the value of the
response first.
explorer works fine. what is the problem.


Probably your document gets loaded asynchronously and isn't fully loaded
when you requesting it. To get a synchonous load send a third parameter
(false) for your open command:
var httpRequest = new XMLHttpRequest();
var doc=null;
if (httpRequest) {
httpRequest.open('GET', file, false);
httpRequest.send(null);
doc = httpRequest.responseXML;
}
return doc;

see
http://unstable.elemental.com/mozill...equest.html#a4

Daniel
Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Robert Cholewa | last post: by
12 posts views Thread by Botan Guner | last post: by
14 posts views Thread by squash | last post: by
7 posts views Thread by burtonfigg | last post: by

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.