AJAX cross domain call

前端 未结 11 939
温柔的废话
温柔的废话 2020-11-22 03:43

I know about AJAX cross-domain policy. So I can\'t just call \"http://www.google.com\" over a ajax HTTP request and display the results somewhere on my site.

I tried

11条回答
  •  遥遥无期
    2020-11-22 03:55

    Unfortunately (or fortunately) not. The cross-domain policy is there for a reason, if it were easy to get around it then it wouldn't be very effective as a security measure. Other than JSONP, the only option is to proxy the pages using your own server.

    With an iframe, they are subject to the same policy. Of course you can display the data from an external domain, you just can't manipulate it.

提交回复
热议问题