hi actually i am trying to get the content of any page which is provided...i am able to content if the page is in same server if i provide another server name its not working.i know we can easily achieve in jquery but i need it in js only... below the code i using...
<script>
function loadXMLDoc()
{
var xmlhttp;
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{alert(xmlhttp.status);
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
//alert("SADF");
document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
}
}
var url=document.getElementById("url").value;
xmlhttp.open("GET",url,true);
xmlhttp.send();
}
</script>
<div id="myDiv"></div>
<input type="text" name="url" id="url"/>
<button type="button" onclick="loadXMLDoc()">Change Content</button>
thanks in advance...