如何将 ajaxStart/ajaxStop 绑定到表单?
上传文件时我需要一个加载块来显示
现在表格根本没有提交
var iframe = $('<iframe name="iframe_file_upload" src="'+src_file_upload+'" style="display:none"></iframe>');
var btn_send = $('<input type="button" />')
.click(function(){
$('#form_upload_file').bind('ajaxStart', function(){
$(this).submit();
});
iframe.bind('ajaxStop', function(){
$(this).load(function(){
...
更新
var btn_send = $('<input type="button" />')
.click(function(){
$('#form_upload_file').ajaxForm(
$('#form_upload_file').ajaxForm({
success : function(response){
// the response is a string?! how can the response be retrieved as an JSON object?
alert(response);
}
}
}).submit();
});