【小(xiǎo)編推薦】ajax跨域訪問(wèn)問(wèn)題

2015-10-17  &₹✔nbsp;|   發布者:梁國(guó)<↓™₩芳   | &nb ‍sp; 查看(kàn):3320次☆↔☆

前端開(kāi)發
 客戶端 $.ajax({
url : '/app/yanzheng.php?mobile='+una®∞∞me+'&mobilecode='+ucode,
type:'GET', 
dataType:'jsonp',
jsonp:"jsoncallback", λφΩ​;
success:function(response, status, £‌>πxhr){
 alert(response.₹±code);
}
        &nb±₽☆sp;   });
});
服務端
<?php 
header("Content-Typ£≈e: text/html; charset=utf-8");
//header("Access-Control-A ¥₽llow-Origin: *");
define('DT_REWRITE', true);
require '../common.inc∞∞♣₹.php';
$mobile = $_GET['mobile'];•™±​
$mobilecode = $_GET['mobilecode'];₩₹
$r=$db->get_one("select * FROMφ®>δ destoon_duanxin WHERE c∞♣₩₽ode='$mobilecode' and mobile='$mobile' &¥order by id desc");
if($r){
$A['code'] = 1;
echo $_GET['jsoncallback']."(&qu♣∏∞↔ot;.json_encode($A).")"; }>♠
?>