ajax request to different host

后端 未结 4 1673
逝去的感伤
逝去的感伤 2021-01-22 02:03

i have the following javascript in my webpage:

var xhr = new XMLHttpRequest();
xhr.open(\'GET\', \'http://www.google.com\', true);
xhr.onreadystatechange = funct         


        
4条回答
  •  广开言路
    2021-01-22 02:22

    You can't do cross-domain requests with javascript. The best way round this is to use your server as a proxy.

提交回复
热议问题