how to grab whole remote page using java script.. example i want to grab www.remotesite.com using java script to show its full content on other remote site.. pls help me
how to grab whole remote page using java script
Started on the old forum in August 2012 · view the original in the archive · old links redirect here
You cant because of cross site scripting unless you have set permissions on the server you are trying to grab from or you have set permissions like on web browser extensions
Added after 2 minutes:
Here is how to do it if you have got permissions:
<script type="text/javascript">
var xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET", "http://remotesite.con", false);
xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlhttp.send(null);
var respon = xmlhttp.responseText;
document.write(respon);
</script>