Hallo an alle!
Leider finde keine wirkliche Erklärung zu meinem Problem, denn logik schein dem ie fremd, oder mir !?!
folgender code :
<html>
<head>
</head>
<script language="JavaScript">
var Class = { create: function(){ return function(){ this.initialize.apply(this, arguments); } } }
var CAjaxUploadForm = Class.create();
CAjaxUploadForm.prototype.initialize=function(id,reciever,action,target){
this.id=id;
this.reciever=reciever;
this.target=target;
this.action=action;
this.html=function(elementtype){return document.createElement(elementtype);};
this.make=function(){
this._form = document.createElement("FORM");
this._form.id="form_" + id;
this._form.name="form_" + id;
this._form.method="post";
this._form.enctype="multipart/form-data";
this._form.target=this.target;
this._form.action=this.action;
this._file = document.createElement("INPUT");
this._file.type="file";
this._file.id=this._file.name="file_" + this.id;
this._button = document.createElement("INPUT");
this._button.type="button";
this._button.value="upload";
var func = this.onClick(this._form.id);
this._button.onclick=func;
this._form.appendChild(this._file);
this._form.appendChild(this._button);
x=document.getElementById(this.reciever);
x.appendChild(this._form);
}
this.onClick=function(former){
return function(){sub_form(former);}
}
}
var CAjaxUploader = Class.create();
CAjaxUploader.prototype.initialize=function(in_element){
this.htmlelement=in_element;
this.Iframes=new Array();
this.Uploads=new Array();
this.draw=function(Uploads,action){
for(var i=0;i<Uploads;++i){
this.Uploads[i]=new Array();
this.Uploads[i][0]=this.doIframe(i,action);
this.Uploads[i][1]=new CAjaxUploadForm("Form_" + i, this.htmlelement, action, this.Uploads[i][0]);
this.Uploads[i][1].make();
}
}
this.doIframe=function(id,action){
x=document.getElementById(this.htmlelement);
_iframe = document.createElement("IFRAME");
_iframe.id="IFRAME_" + id;
_iframe.name="IFRAME_" + id;
_iframe.src=action;
x.appendChild(_iframe);
return _iframe.id;
}
}
function sub_form(form){
x = document.getElementById(form);
x.submit();
}
</script>
<body>
<div id="UploadArea"></div>
<script language="JavaScript">
var Upload = new CAjaxUploader("UploadArea");
Upload.draw(4,"recieve.php");
</script>
</body>
</html>
Wird vom Firefox einwandfrei ausgeführt, also das generierte formular wird abgesendet und im entsprechend generierten iframe verarbeitet, aber mein freund der internet explorer (v7) senden den post an target="_blank"...
hab noch eben opera gecheckt, der machts auch richtig
kann mir bitte einer ne erklärung geben warum der ie das macht bzw. wie ich den "fehler" umgehen kann ??
mfg
Freddy