Load website into DIV

前端 未结 5 2120
我在风中等你
我在风中等你 2020-11-28 15:12

how do i actually retrieve data from a website when i write the URL in a textbox and then hit the submit button. I want the data to be put in an div that i have. Is this pos

5条回答
  •  南笙
    南笙 (楼主)
    2020-11-28 15:25

    Given that it will not be capable of doing logins or http authentications (for enabling that you can use curl or another http client), this php one liner can be used as a proxy to load content from other sites

    /* proxy.php */
    
    

    than, assuming that you place proxy.php in the same directory of the html page:

    $("#contentArea").load('proxy.php?url=http://example.com');
    

提交回复
热议问题