<?php header('Content-type: application/json'); //獲取回調函數名 $jsoncallback = htmlspecialchars($_REQUEST ['jsoncallback']); //json數據 $json_data = '["customername1","customername2"]'; //輸出jsonp格式的數據 echo $jsoncallback . "(" . $json_data . ")"; ?>
$.getJSON("http://www.runoob.com/try/ajax/jsonp.php?jsoncallback=?", function(data) { });
$.ajax({ url:"?????/mt4check.php?jsoncallback=?", dataType:"jsonp", success:function (data) { } })