Thread: [xmljs-users] XmlHttpRequest Object
Brought to you by:
djoham,
witchhunter
From: Heath B. <hea...@gm...> - 2005-01-06 14:26:50
|
I'm trying to use the XmlHttpRequest Object to make requests back to my web server to retrieve some Xml data. The request object itself works fine and the request comes back just fine. However, every time I make the request, my browser prompts my about using an ActiveX control that is safe for scripting. The example websites I've viewed that use the XmlHttpRequest Object call it the same way I do, and I don't get this warning when I view those pages. Here is a link to an example page: http://developer.apple.com/internet/webcontent/XMLHttpRequestExample/example.html Here is my function that actually calls the XmlHttpRequest Object: function loadXMLDoc(url) { // branch for native XMLHttpRequest object if (window.XMLHttpRequest) { req = new XMLHttpRequest(); req.onreadystatechange = processReqChange; req.open("GET", url, true); req.send(null); // branch for IE/Windows ActiveX version } else if (window.ActiveXObject) { req = new ActiveXObject("Microsoft.XMLHTTP"); if (req) { req.onreadystatechange = processReqChange; req.open("GET", url, true); req.send(); } } } -- -Heath Borders-Wing hbo...@ma... |
From: David J. <dj...@ya...> - 2005-01-06 18:10:07
|
From a quick inspection, that looks like it should work OK. XML for <SCRIPT> doesn't use XMLHttpRequest so beyond that, I'm at a loss :) David --- Heath Borders <hea...@gm...> wrote: > I'm trying to use the XmlHttpRequest Object to make requests back to > my web server to retrieve some Xml data. The request object itself > works fine and the request comes back just fine. However, every time > I make the request, my browser prompts my about using an ActiveX > control that is safe for scripting. The example websites I've viewed > that use the XmlHttpRequest Object call it the same way I do, and I > don't get this warning when I view those pages. > > Here is a link to an example page: > > http://developer.apple.com/internet/webcontent/XMLHttpRequestExample/example.html > > Here is my function that actually calls the XmlHttpRequest Object: > function loadXMLDoc(url) { > // branch for native XMLHttpRequest object > if (window.XMLHttpRequest) { > req = new XMLHttpRequest(); > req.onreadystatechange = processReqChange; > req.open("GET", url, true); > req.send(null); > // branch for IE/Windows ActiveX version > } else if (window.ActiveXObject) { > req = new ActiveXObject("Microsoft.XMLHTTP"); > if (req) { > req.onreadystatechange = processReqChange; > req.open("GET", url, true); > req.send(); > } > } > } > > -- > -Heath Borders-Wing > hbo...@ma... > > > ------------------------------------------------------- > The SF.Net email is sponsored by: Beat the post-holiday blues > Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. > It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt > _______________________________________________ > xmljs-users mailing list > xml...@li... > https://lists.sourceforge.net/lists/listinfo/xmljs-users > |
From: Heath B. <hea...@gm...> - 2005-01-06 19:21:21
|
I figured out what it was. IE throws the ActiveX warning if you call the XmlHttpRequest object from a page served from your localhost. Since, I was running my webserver on the same computer, it was giving me the warning. When I ran it from an external computer, it was fine. Thanks. On Thu, 6 Jan 2005 10:09:56 -0800 (PST), David Joham <dj...@ya...> wrote: > > From a quick inspection, that looks like it should work OK. XML for <SCRIPT> doesn't use > XMLHttpRequest so beyond that, I'm at a loss :) > > David > > --- Heath Borders <hea...@gm...> wrote: > > > I'm trying to use the XmlHttpRequest Object to make requests back to > > my web server to retrieve some Xml data. The request object itself > > works fine and the request comes back just fine. However, every time > > I make the request, my browser prompts my about using an ActiveX > > control that is safe for scripting. The example websites I've viewed > > that use the XmlHttpRequest Object call it the same way I do, and I > > don't get this warning when I view those pages. > > > > Here is a link to an example page: > > > > http://developer.apple.com/internet/webcontent/XMLHttpRequestExample/example.html > > > > Here is my function that actually calls the XmlHttpRequest Object: > > function loadXMLDoc(url) { > > // branch for native XMLHttpRequest object > > if (window.XMLHttpRequest) { > > req = new XMLHttpRequest(); > > req.onreadystatechange = processReqChange; > > req.open("GET", url, true); > > req.send(null); > > // branch for IE/Windows ActiveX version > > } else if (window.ActiveXObject) { > > req = new ActiveXObject("Microsoft.XMLHTTP"); > > if (req) { > > req.onreadystatechange = processReqChange; > > req.open("GET", url, true); > > req.send(); > > } > > } > > } > > > > -- > > -Heath Borders-Wing > > hbo...@ma... > > > > > > ------------------------------------------------------- > > The SF.Net email is sponsored by: Beat the post-holiday blues > > Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. > > It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt > > _______________________________________________ > > xmljs-users mailing list > > xml...@li... > > https://lists.sourceforge.net/lists/listinfo/xmljs-users > > > > ------------------------------------------------------- > The SF.Net email is sponsored by: Beat the post-holiday blues > Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. > It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt > _______________________________________________ > xmljs-users mailing list > xml...@li... > https://lists.sourceforge.net/lists/listinfo/xmljs-users > -- -Heath Borders-Wing hbo...@ma... |