Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/290.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 在ajax调用后添加不起作用的类_Php_Jquery - Fatal编程技术网

Php 在ajax调用后添加不起作用的类

Php 在ajax调用后添加不起作用的类,php,jquery,Php,Jquery,在ajax调用之前添加类,但在ajax调用之后不添加类 $.ajax({ type: "POST", url: "../ajax/basket.php", data: {planproductId: productIDVal, action: "addToBasket"}, success: function(theResponse) { if (theResponse

在ajax调用之前添加类,但在ajax调用之后不添加类

$.ajax({
            type: "POST",
            url: "../ajax/basket.php",
            data: {planproductId: productIDVal, action: "addToBasket"},
            success: function(theResponse) {
                if (theResponse.indexOf("<li>" < 0))
                {
                    $("#notication").addClass('error-box');
                    $("#notification").text(theResponse);
                    $("#notificationsLoader").empty();
                    return;
                }
            }
       });
这应该是

$("#notification").addClass('error-box');
 if (theResponse.indexOf("<li>") < 0)
不是

$("#notication").addClass('error-box');
这应该是

$("#notification").addClass('error-box');
 if (theResponse.indexOf("<li>") < 0)
if(响应索引(“
  • ”)<0)
  • 这应该是

    $("#notification").addClass('error-box');
    
     if (theResponse.indexOf("<li>") < 0)
    
    不是

    $("#notication").addClass('error-box');
    
    这应该是

    $("#notification").addClass('error-box');
    
     if (theResponse.indexOf("<li>") < 0)
    
    if(响应索引(“
  • ”)<0)
  • 如果您的情况不正确-应该是这样的(假设
    #注意到
    是一个打字错误)

    if(响应索引(“
  • ”)<0)
  • 如果您的情况不正确-应该是这样的(假设
    #注意到
    是一个打字错误)

    if(响应索引(“
  • ”)<0)
  • 安装拼写检查以显示
    通知
    拼写错误?安装拼写检查以显示
    通知
    拼写错误?我不认为
    通知
    是错误的。OP不需要重新选择相同的元素。是的,他不需要,但人们总是这样做。我不认为
    通知
    是一个错误。OP不需要重新选择相同的元素。是的,他不需要,但人们总是这样做。