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

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

Jun 13, 2016 pm 12:54 PM
ajax name nbsp user

一个关于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 不存在
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

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

10 Ways to Adjust Brightness on Windows 11 10 Ways to Adjust Brightness on Windows 11 Dec 18, 2023 pm 02:21 PM

10 Ways to Adjust Brightness on Windows 11

How to turn off private browsing authentication for iPhone in Safari? How to turn off private browsing authentication for iPhone in Safari? Nov 29, 2023 pm 11:21 PM

How to turn off private browsing authentication for iPhone in Safari?

How to solve the 403 error encountered by jQuery AJAX request How to solve the 403 error encountered by jQuery AJAX request Feb 20, 2024 am 10:07 AM

How to solve the 403 error encountered by jQuery AJAX request

How to solve jQuery AJAX request 403 error How to solve jQuery AJAX request 403 error Feb 19, 2024 pm 05:55 PM

How to solve jQuery AJAX request 403 error

How to get variables from PHP method using Ajax? How to get variables from PHP method using Ajax? Mar 09, 2024 pm 05:36 PM

How to get variables from PHP method using Ajax?

How to solve the problem of jQuery AJAX error 403? How to solve the problem of jQuery AJAX error 403? Feb 23, 2024 pm 04:27 PM

How to solve the problem of jQuery AJAX error 403?

PHP vs. Ajax: Solutions for creating dynamically loaded content PHP vs. Ajax: Solutions for creating dynamically loaded content Jun 06, 2024 pm 01:12 PM

PHP vs. Ajax: Solutions for creating dynamically loaded content

Understanding Ajax Frameworks: Explore Five Common Frameworks Understanding Ajax Frameworks: Explore Five Common Frameworks Jan 26, 2024 am 09:28 AM

Understanding Ajax Frameworks: Explore Five Common Frameworks

See all articles