jQuery Cross Site Fetch

前端 未结 4 1327
轮回少年
轮回少年 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:29

    You can't do that - the Same Origin Policy prevents it for security reasons (as you've found).

    You need to run a proxy script on your own server that your JavaScript uses to fetch the content from the remote server on its behalf.

提交回复
热议问题