2012-03-06 192 views
0

我有一个简单的jQuery功能在这里:疯狂jQuery的Ajax错误

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" 
    }); 
} 

我发誓,上帝,假如我这样从A 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"; 
}); 

它总是触发成功。 这是可笑的,我只是不明白。 Plase help ... Q. &

+0

任何想法?..... – Anonymous 2012-03-06 08:11:43

+0

什么是错误? – 2012-03-06 08:12:42

+0

尝试使用提琴手和调试。你会知道错误信息。 – dhinesh 2012-03-06 08:15:45

回答

0

我放弃了一个href,并使用了一个SPAN。这是问题与JavaScript无效(0)