XmlHttpCrossDomain Request in javascript

Posted by Sakthiae under JavaScript on 2/20/2013 | Points: 10 | Views : 828 | Status : [Member] | Replies : 0
<script type="text/javascript">
var xhr = new XMLHttpRequest();

xhr.open("GET", "http://www.bing.com/images/search?q=sunset&go=&qs=n&form=QBLH&filt=all&pq=sunset&sc=8-6&sp=-1&sk=", true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status == 200 || xhr.status == 0) {
alert(xhr.statusText);
alert(xhr.responseText);
} else {
alert("ERROR");
}
}
};
xhr.send(null);
</script>


Hi am using this code for getting the response text from the server.
xht.status is coming 200 in IE and xhr.status is coming 0 in mozila.
Responsetext is coming in IE but in mozila responsetext is coming empty.

If i once published this code means also am not getting the responsetext.

Please any one help me to how to get the responsetext in mozila and after published in server

sakthi


Responses

(No response found.)

Login to post response