Load external content using AJAX

后端 未结 2 890
无人及你
无人及你 2020-12-22 10:44

Is it possible to load an external site\'s content using jQuery\'s Ajax rather than an iFrame?

This is what I am trying to achieve, but it would seem there might be

2条回答
  •  既然无缘
    2020-12-22 11:27

    It is possible, in part. You'll need to have your server act as a proxy:

    $('#result').load('fetch.php?s=http://www.google.com');
    // or something like that
    

    As for having the client load a page cross-domain, it won't (shouldn't) be possible.

提交回复
热议问题