Home > Backend Development > PHP Tutorial > 一个关于ajax的有关问题,帮忙看上是什么情况

一个关于ajax的有关问题,帮忙看上是什么情况

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 12:54:43
Original
846 people have browsed it

一个关于ajax的问题,帮忙看下是什么情况
HTML代码:
 


    会员编号:

  

js代码:
function get_user_jifen(user_name){
if(user_name == ""){
//document.getElementById('user_jifen').innerHTML = "用户名不能为空";
$("#user_jifen").html("用户名不能为空");
return false;
} else {
$.ajax({
   type: "POST",
   url: "user_jifen.php",
   dataType:"html",
   data: "act=ajax&user_name="+user_name,
   success:function(msg){
  $("#user_jifen").html(msg);
   },
   error:function()
{
$("#user_jifen").html("查询出错");

});
}
}

PHP代码:
//会员积分兑换ajax
elseif ($_REQUEST['act'] == 'ajax')
{
/* 权限的判断 */
    //admin_priv('logs_manage');
/* 模板赋值 */
    echo "成功进入";
}


运行之后,老是在ajax那块进入error提示:



帮忙看下,该怎么解决?

------解决方案--------------------
换成$_POST试试
或者根本没进入elseif这块
------解决方案--------------------
user_jifen.php 不存在
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template