您的位置:首页 > 其它

ajax在同一个页面获取Post的数据

2014-11-21 16:06 316 查看
<?php

if($_POST['act'] == 'get'){

   $action = 2;

 

   if($action == 2){

       $is_gz = 0;

   }else{

       $is_gz = 1;

   }

   echo $is_gz;

   exit;  

}

?>

<html>

<head>

<script src="jquery-1.11.1.min.js" type="text/javascript"></script>

</head>

<body>

<script>

$.post(location.href,{act:'get',action:2},function(d,s){

    //alert(22);

    if(d == 0){

        alert(11);

    }

});

</script>

</body>

</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐