测试jsonp

login
<?php
$type = $_GET['type'];
if(empty($type)) {
$url = "";

}else {
if($type == 'logout') {
$url = "";
} else{
$url = ";
}
}
?>
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
<script type="text/javascript">
$(function(){
$.ajax({
type: "get",
url: "<?php echo $url;?>",
xhrFields: {
withCredentials: true
},
crossDomain: true,
dataType: "jsonp",
jsonp:"jsoncallback",
success: function (res) {
alert(res.msg)
}
});
})
</script>
posted @ 2017-09-21 18:05  brady-wang  阅读(389)  评论(0编辑  收藏  举报