如果我在 beforeSubmit 或 beforeSend 中从 DOM 中删除表单(不管是哪一个),我发现在 IE 和 FF 中,永远不会发出 http 请求。调用 jquery.form.js 中的 form.submit() 第 296 行,但没有发出 http 请求。它虽然在 chrome 中正常工作。
示例代码:
$('#form1').ajaxForm(
{
beforeSubmit: function(array, matched_set, options)
{
// this line removes #form1 from the DOM.
// it is still available to jquery form plugin by means of closure
// line 296 form.submit() in jquery.form.js is hit,
// but IE and FF never emit http request. If I remove this line, it works.
$('#jqm_window').html(waiting_page);
},
chrome:
firefox:
使用 chrome 时在 fiddler 中捕获 http 跟踪(但不使用其他浏览器):