我試圖冰AJAX觸發:beforeSend,AJAX:錯誤和Ajax:完整的我的軌道形成被遠程提交。AJAX:beforeSend得到任何Ajax調用
我使用代理,綁定,實時等嘗試,但我仍然面臨着同樣的問題。
$('form#contact_form').bind('ajax:beforeSend', function(evt, xhr, settings) {
//getItemIds(); added this call on button click
call();
})
.bind('ajax:error', function(event, request, settings) {
text();
})
.bind('ajax:complete', function(event, request, settings) {
phone();
});
我的頁面也使Ajax調用其他錨鏈接,但對於任何Ajax調用所做的形式「beforesend」功能獲取調用。我只想爲特定的表單調用它。
當我做警報(event.target.id);在ajaxBeforesend裏面我看到了,我都沒有綁定Ajax調用
I am targeting only a specific form so how that before send be triggered for other links? Can anyone tell what is that i am doing wrong, Thanks.
NOTE: When i commented out the jquery_ui.js this behaviour stopped happening. Is is some conflict issue, Please help.
形式是動態的嗎? – epascarello
是的,它是一個Rails的形式爲您解答 –