开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜