点击按钮后脚本正在运行:
$.ajax({
url: "<?php echo CHILD_URL; ?>/takeaway-orders.php",
type: 'POST',
async:false,
data: 'uniq='+encodeURIComponent(uniq)+'&menu_id='+encodeURIComponent(menuid)+'&quan='+encodeURIComponent(quan)+'&price='+encodeURIComponent(price)+'&tillval_count='+tillval_count,
success: function(value){
var resid = value;
if(tillval_count>0){
$('.special_request_content').html('<center><img src="'+siteurl+'/images/loader.gif'+'"></center>');
$.ajax({
url: "<?php echo CHILD_URL; ?>/special-request.php",
type: 'POST',
async:false,
data: 'id='+encodeURIComponent(resid)+'&menu_det='+encodeURIComponent(menu_det)+'&siteurl='+encodeURIComponent('<?php echo CHILD_URL; ?>')+'&temp_tillval=1&price='+encodeURIComponent(price),
success: function(value){
$('.special_request_content').html(value);
}
});
$('.fader, #special_request').fadeIn();
$('#btn_skip').click(function(){
//for the cart
getcountItem(0);
});
}
else{
$('#takeaway .cart_content').html('<center><img src="'+siteurl+'/images/loader.gif'+'"></center>');
$('#takeaway .cart_content').load("<?php echo CHILD_URL.'/takeaway-cart.php';?>");
//for the cart
getcountItem(0);
}
}
});
我还想在点击按钮时显示一个名为takeaway的类。请帮我解决这个问题。
$('.special_request_content').html('<center><img src="'+siteurl+'/images/loader.gif'+'"></center>');
$.ajax({
url: "<?php echo CHILD_URL; ?>/special-request.php",
type: 'POST',
async:false,
data: 'id='+encodeURIComponent(resid)+'&menu_det='+encodeURIComponent(menu_det)+'&siteurl='+encodeURIComponent('<?php echo CHILD_URL; ?>')+'&temp_tillval=1&price='+encodeURIComponent(price),
success: function(value){
$('.special_request_content').html(value);
$('.takeaway').show();
}
});