开发者

jQuery -> getJSON -> Data load fail on outside server -> IE issue only <- All other browsers work

开发者 https://www.devze.com 2023-03-14 18:28 出处:网络
jQuery -> getJSON -> Data load fails on outside server. This开发者_如何学C works fine on all other browsers but IE9.I\'ve set headers (active...origin:* etc) on the php script that delivers JSON data

jQuery -> getJSON -> Data load fails on outside server.

This开发者_如何学C works fine on all other browsers but IE9. I've set headers (active...origin:* etc) on the php script that delivers JSON data from the primary server.

What needs to happen to jQuery / getJSON to get IE to retrieve the data.


try using JSONP

here is what you need to do in your php script

<?
$data = '{"name" : "hello world"}';
echo $_GET['jsoncallback'] . '(' . $data . ');';
?>

and in the url just add

&jsoncallback=?
0

精彩评论

暂无评论...
验证码 换一张
取 消