XMLHttpRequest Origin is not allowed by Access-Control-Allow-Origin

后端 未结 2 522
醉梦人生
醉梦人生 2020-12-20 09:57

I\'m trying to fetch some simple text over HTTP from JavaScript:

$(function() {
    $.get(\"http://mydomain.com/path\", function(result) {
        console.lo         


        
2条回答
  •  无人及你
    2020-12-20 10:18

    You can't request that page because of Same Origin Policy unless that page has explicitly allowed you with CORS.

    Either proxy it server side, with a service such as YQL, get it as JSONP or get the other service to enable CORS for your domain.

提交回复
热议问题