how to grab whole remote page using java script

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    how to grab whole remote page using java script

    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

    #2
    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:
    PHP Code:
    <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
    Last edited by something else; 07.09.12, 16:19.

    Comment

    Working...
    X