可以使用jquery裡面的ajax中的jsonp的方式來訪問就可以了。代碼如下:
url: 'your url' data: {'xx' : 'xx', 'xx2' : 'xx2' success:
type:'GET' dataType: 'jsonp',
jsonp: "callback" jsonpCallback:"jsonpReturn"
});
php中可以這樣寫:
'jsonpReturn('.jsondecode().')' }