Php 在ajax调用后添加不起作用的类
在ajax调用之前添加类,但在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({
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不需要重新选择相同的元素。是的,他不需要,但人们总是这样做。