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

            }

        })

 

posted @ 2016-11-03 15:09  Ali.Blacken  阅读(152)  评论(0编辑  收藏  举报