B
balakrishnan.dinesh
Hi frends & collins,
The code below is the one Im using now for xmlhttp request
in IE as well as Netscape browser.I have put this code in a server,if i
want to retrive the data from the same server ,then its working fine in
both IE & NN browser .
My problem is, If i want to retrive the data from other servers
which this code is not present there, then its not working.
for example: Im having two servers , servernames : sever1 & server2
if i putting the code below in sevr1 , and i request a
page or any data from servr1 mean its working and im getting the
response.
But i give the request to get some data from servr2
mean its not working.
it showing the error called "Permission denied"
So plz give some suggestion or correct my code to work for retriving
the data from other servers
<html>
<script>
var xmlhttp;
function SubmitthroXML(url) /* Used to get the Response through
XmlHttp */
{
if (window.XMLHttpRequest)
{
xmlhttp=new XMLHttpRequest();
// alert(xmlhttp);
//alert("state "+state_Change());
xmlhttp.onreadystatechange=state_Change()
//alert("ready "+xmlhttp.onreadystatechange)
xmlhttp.open("GET",url,true);
//alert("inside"+xmlhttp.open("GET",url,true));
xmlhttp.send(null)
}
/* code for IE */
else if (window.ActiveXObject)
{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
if (xmlhttp)
{
alert();
xmlhttp.onreadystatechange=state_Change
xmlhttp.open("GET",url,true)
xmlhttp.send()
}
}
}
function state_Change()
{
alert("ready state "+xmlhttp.readyState);
/* if xmlhttp shows "loaded" */
if (xmlhttp.readyState==4)
{
alert("status "+xmlhttp.status);
/* if "OK" */
if (xmlhttp.status==200)
{
CrossDomainPage = xmlhttp.responseText;
if (CrossDomainPage == " ")
{
alert("Taexpert Server is Down!!Please Wait");
return null;
}
//If needed use this piece of code
document.getElementById('idname').innerHTML =
CrossDomainPage;
}
else
{
alert(xmlhttp.status+"Problem retrieving data:")
}
}
}
</script>
<body onload=SubmitthroXML('http://192.168.1.87/bank/index.htm');>
<div id="idname"></div>
</body>
</html>
The code below is the one Im using now for xmlhttp request
in IE as well as Netscape browser.I have put this code in a server,if i
want to retrive the data from the same server ,then its working fine in
both IE & NN browser .
My problem is, If i want to retrive the data from other servers
which this code is not present there, then its not working.
for example: Im having two servers , servernames : sever1 & server2
if i putting the code below in sevr1 , and i request a
page or any data from servr1 mean its working and im getting the
response.
But i give the request to get some data from servr2
mean its not working.
it showing the error called "Permission denied"
So plz give some suggestion or correct my code to work for retriving
the data from other servers
<html>
<script>
var xmlhttp;
function SubmitthroXML(url) /* Used to get the Response through
XmlHttp */
{
if (window.XMLHttpRequest)
{
xmlhttp=new XMLHttpRequest();
// alert(xmlhttp);
//alert("state "+state_Change());
xmlhttp.onreadystatechange=state_Change()
//alert("ready "+xmlhttp.onreadystatechange)
xmlhttp.open("GET",url,true);
//alert("inside"+xmlhttp.open("GET",url,true));
xmlhttp.send(null)
}
/* code for IE */
else if (window.ActiveXObject)
{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
if (xmlhttp)
{
alert();
xmlhttp.onreadystatechange=state_Change
xmlhttp.open("GET",url,true)
xmlhttp.send()
}
}
}
function state_Change()
{
alert("ready state "+xmlhttp.readyState);
/* if xmlhttp shows "loaded" */
if (xmlhttp.readyState==4)
{
alert("status "+xmlhttp.status);
/* if "OK" */
if (xmlhttp.status==200)
{
CrossDomainPage = xmlhttp.responseText;
if (CrossDomainPage == " ")
{
alert("Taexpert Server is Down!!Please Wait");
return null;
}
//If needed use this piece of code
document.getElementById('idname').innerHTML =
CrossDomainPage;
}
else
{
alert(xmlhttp.status+"Problem retrieving data:")
}
}
}
</script>
<body onload=SubmitthroXML('http://192.168.1.87/bank/index.htm');>
<div id="idname"></div>
</body>
</html>