Is there any way to use the JQuery GetJSON method to get HTML from an external page?

前端 未结 3 564
野趣味
野趣味 2021-01-26 04:11

So let\'s say you\'re trying to do a jquery ajax request, something like:

$.ajax({
    ...
    url: http://other-website.com
    ...
})

I under

3条回答
  •  抹茶落季
    2021-01-26 04:45

    The answer is no, you cannot trick it or force it to load html from an external source. GetJSON only works on servers that serve JSONP, and only valid JSON objects are able to be read.

提交回复
热议问题