在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;
}
}
});
.error-box {
background:#ffecec url('../img/error.png') no-repeat 10px 50%;
border:1px solid #f5aca6;
}