我在这里有一个简单的Jquery函数:
function submit_selection(del,submit)
{
del='yes';
submit=true;
var ITAMZ=new Array();
var count=0;
if (submit)
$('input[group="Blaaa"]:checked').each (function(){
ITAMZ[count]=$(this).attr('name');
count+=1;
});
$('#s_o_s_r').html('Submitting...');
$.ajax({
url: "script/order_select_submit.php",
context: document.body,
success: function(data){
$('#s_o_s_r').html(data);
},
error: function()
{
$('#s_o_s_r').html('error submitting');
},
async:true,
type: "POST",
data: {'ITAMZ' : ITAMZ, 'delete': del},
dataType: "html"
});
}
我发誓上帝,如果我从这样的href中触发它:
$('#remove_sel').click(function(){
submit_selection('yes',true);
});
它总是返回一个错误,但如果我从这样的按钮触发它:
$('input.client_btn').click(function(){
var shiiit=$(this).attr('name');
if (shiiit=='all') document.location.href="order_price.php?show=all";
else if (shiiit=='selected') {
///document.location.href="order_price.php?show=selected";
submit_selection('yes',true);
}
else document.location.href="order_price.php";
});
它总能触发成功。 这太荒谬了,我只是不明白。 请帮助...... Q.&
答案 0 :(得分:0)
我放弃了一个href,并使用了SPAN。这是javascript void(0)
的问题