JSONP

<?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) {

            }

        })
相關文章
相關標籤/搜索
本站公眾號
   歡迎關注本站公眾號,獲取更多信息