XmlHttpRequest OnReadyState Only Fires on Local Browser

G

Guest

Hi, I'm trying to do an elementary non-postback page refresh and the
following (edited) javascript snippet defines my problem:

xhttp = new ActiveXObject("Msxml2.XMLHTTP");
xhttp.onreadystatechange = HandlerOnReadyStateChange;
xhttp.open("GET", http://jeb.tzo.com/xmlr/sample.ashx?portfolio=1,
false);
xhttp.send();

When this code is run on a browser running on the server, it works. The
OnReadyStateChange event fires. But, when it is run on a remotely situated
browser it does not work. You can see it fail here:

http://www.geocities.com/jebbushell/xmlr/sample.htm

Could this be a permissions issue? Does IIS somehow know when the request
is local? I'm using XP2.

Also, do I need a book? So far, none of the web articles/tutorials has
given me a completely satisfactory outcome. Your advice could really help me.

Thanks,
Jeb.
 
G

Guest

If you like this type of stuff, look at Ajax. It is still the same thing,
basically, but there is a framework you can add to your apps.

For things that have to go live right now, Ajax.NET is a good open source
project.
http://ajax.schwarz-interactive.de/csharpsample/default.aspx

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 
B

Bruce Barker

the client needs version 2 xmlhttp installed to support onreadystatechange.
also the url in the open has to be the same site as the page hosting the
javascript. (cross site scripting security).

-- bruce (sqlwork.com)
 
Q

qt92sb4y9u41q001

The code works for me either on the geocities page or on my hard drive.
I just saved the html and ran it from my computer and after it counted
through the 4 readystates I got Authorized Financial Analyst filled
with "John Doe". I don't know, was that what was supposed to happen.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,996
Messages
2,570,237
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top