简体   繁体   中英

AjaxForm file upload in Firefox 4

<form action="upload.aspx" enctype="multipart/form-data" id="ajaxUploadForm" method="post">
<input type="file" name="fileBase" id="fileBase"><input type="submit" value="send" />
</form>

$( "#ajaxUploadForm" ).ajaxForm( {
iframe: "true",cache: false,
success: function ( response )
{
   var msg = $.parseJSON( $( response ).val() );
   alert ( msg.status); 
}
}} );

When i try to send ajax form i have an error (only in Firefox 4):

"uncaught exception: [Exception... "Component returned failure code: 0x805e0006 [nsIDOMHTMLFormElement.submit]" nsresult: "0x805e0006 ()" location: "JS frame :: http://localhost/Scripts/jquery/jquery.form.js :: doSubmit :: line 295" data: no] Line 0"

i use jquery 1.5.1 and jquery.from 2.67

Thx for any suggestion

There is a new version of the JQuery Form plug in that was released 2 days ago. I tried their demo in Firefox 4 and it seems to work very well, so maybe you can try changing the plug in version.

Recently I encountered similar error when trying to send ajax request with jquery. It worked on chrome, IE, Opera, but failed on FF. After hours wasted on debugging it turned out that AdBlock Plus was blocking my request. So if You didn't solve the problem already, try to turn off AdBlock.

您无法使用ajax上传文件,因为您需要使用iframe或Flash。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM