Access to restricted URI denied code: 1012

后端 未结 5 1793
抹茶落季
抹茶落季 2020-12-04 15:03

How do you get around this Ajax cross site scripting problem on FireFox 3?

5条回答
  •  广开言路
    2020-12-04 15:12

    If you're using jQuery it has a callback function to overcome this:

    http://docs.jquery.com/Ajax/jQuery.ajax#options

    As of jQuery 1.2, you can load JSON data located on another domain if you specify a JSONP callback, which can be done like so: "myurl?callback=?". jQuery automatically replaces the ? with the correct method name to call, calling your specified callback. Or, if you set the dataType to "jsonp" a callback will be automatically added to your Ajax request.

    Alternatively you could make your ajax request to a server-side script which does the cross-domain call for you, then passes the data back to your script

提交回复
热议问题