jquery.form.js with option iframeTarget (works fine for FF, does not work in IE)
i need a interface to upload multiple file to a DMS, where i can not modify the Result Page.
I have a solution with jquery.form.js (without using iframeTarget), which works fine for FF but does not work for IE: In IE i got the first file uploaded, but after this, the Page is redirected and the second upload does not work.
I think, the main Problem is, that the Resulting Page does a redirect, which i expect inside the IFrame (for FF) but on the page (for IE).
With Firebug i see, that the result of the Post contains such a redirect, wich is "ignored" by FF and so the following files are uploaded.
To get closer to the Problem it tried to use the option iframeTarget. Now i have a similar issue in FF: By using iframeTarget="#myIFrame" i have this:
in FF:
- first file uploaded
- redirct in the IFrame "#myIFrame"
- scirpt stoped (the following files are not uploaded)
in IE:
- first file uploaded
- redirect in the whole page (and the followoing fiels are not uploaded)
If i do not use the iframeTarget option, it works again with FF (all Files uploaded without any redirect).
Main issue: how to get it working in IE?
Side Issue: what's the difference for FF by using this option "iframeTarget"? (May be, this points to the solution for IE)
basic code:
jQuery('#CreateFormUploadNew').submit(function() {
// submit the form
//jQuery(this).ajaxSubmit({
//jQuery('#CreateFormUploadNew').ajaxForm({
jQuery('#CreateFormUploadNew').ajaxSubmit({
//iframe: false, //falls false, werden keine Files hochgeladen, true oder weglassen ....
//clearForm: true, //nicht aktivieren, sonst开发者_如何学JAVA fehlt der Name bei der suchen nach der ObjId
//resetForm: true, //nicht aktivieren, sonst fehlt der Name bei der suchen nach der ObjId
//dataType: 'script',
iframeTarget: '#myIframe',
beforeSubmit: function(a,f,o) {
changeUploadValues(i)
i++
},
success: function(data) {
jQuery("#uploadFeedback").append("success started<br />");
//...
//some additional stuff like setting Meta Data
//...
if (i > 1) {
changeUploadValues(i)
jQuery('#CreateFormUploadNew').submit();
}
} //Success
});
// return false to prevent normal browser submit and page navigation
return false; //ajaxSubmit()
}); //submit
Thomas
精彩评论