php jsonp 跨域问题 js端
$(function () {
$.ajax({
url : 'http://www.che.com/ajax/jsonp/islogin.htm',
type : "get",
data:'',
dataType : "jsonp",
jsonp:'callback',
async: false,
success:function(data){
var headStr='';
var current_url=window.location.href;
if(data.success==false){
headStr='<a href="http://www.che.com/login.htm?returnurl='+current_url+'" class="bitStyle">个人登录</a>';
}else{
headStr='<a href="http://www.che.com/user/center/index.htm" class="bitStyle">您好!'+data+'</a>'+' <a href="http://www.che.com/_logout.htm?returnurl='+current_url+'" class="bitStyle">退出</a>';
}
$("#cheLogin").html(headStr);
},
error:function(json){
//alert('fail');
}
})
})