// Show Cart Quantity
function showCartById(){
var inProcess = false;//Just to make sure that the last ajax call is not in process
if (inProcess) {
return false;//Another request is active, decline timer call ...
}
inProcess = true;//make it burn ;)
var sId = $(this).attr('sid');
var data = 'sId='+sId;
jQuery.ajax({
url: 'cart.php', //Define your script url here ...
data: data, //Pass some data if you need to
method: 'POST', //Makes sense only if you passing data
success: function(answer) {
alert(answer)
inProcess = false;//Queue is free, guys ;)
},
error: function() {
//unknown error occorupted
inProcess = false;//Queue is free, guys ;)
}
});
}
我想通过ajax请求方法传递我的PHP Session_id()。但是如果没有Session_id(),它会很好地工作。
答案 0 :(得分:0)
您可以执行var session_id = '<?php echo session_id();?>';
并将其传递给数据