jQuery Cross Site Fetch

前端 未结 4 1228
轮回少年
轮回少年 2021-01-24 16:47

I feel like this is easy but I am missing something...

Using jQuery, I am trying to fetch a remote page (on a different server), capture the HTML contents, and inject

4条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-24 17:34

    If you want to go cross site, you can't pull in an entire page. There is a way to get data from cross domain sites using JSONP. What you do, is make the js call the data you get back as a function which will evaluate json data. But wont work if you are trying to fetch an entire page, however.

提交回复
热议问题