AJAX cross domain call

前端 未结 11 1093
温柔的废话
温柔的废话 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 04:06

    If you are using a php script to get the answer from the remote server, add this line at the begining:

    header("Access-Control-Allow-Origin: *");
    

提交回复
热议问题