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

            }

        })
原文地址:https://www.cnblogs.com/aliblogs/p/6026695.html