好了,所以我有這樣的jQuery什麼會導致ajax請求不能觸發?
$('.remove_me').click(function(){
var value = $(this).attr('title');
console.log('In here');
console.log(value);
$.ajax({
type: 'post',
url: "/shop_pos/index.php?route=module/cart/ajax_remove_item",
dataType: 'json',
data: {value : value},
success: function (data) {
},
complete: function() {
}
});
console.log(value);
});
,並在螢火蟲的console.logs顯示控制檯,但沒有傳出阿賈克斯request..I甚至嘗試這樣做,仍然沒有
$('.remove_me').click(function(){
var value = $(this).attr('title');
console.log('in here');
console.log(value);
$.getJSON('/shop_pos/index.php?route=module/cart/ajax_remove_item', {value: value}, function(data, textStatus)
{
console.log('not getting in here');
//optional stuff to do after success
});
console.log(value);
});
什麼會導致ajax請求不會觸發
添加服務器端的一些日誌,以檢查其沒有真正達到。也在第1 ajax調用把一些日誌的成功和錯誤功能... – Neal
我試過了,它沒有得到腳本 – Trace
這在Chrome和Firefox的罰款:http://jsfiddle.net/2hGg9/7/ – Colin