Nieuw lid |
|
Ik heb volgende stuk script wat steeds een iframe hidden moet maken en dan een nieuw iframe aanmaken. Het iframe verdwijnt wel, maar er wordt geen nieuw aangemaakt.
var par = window.parent.document;
//hide old iframe
var iframes = par.getElementsByName("iframe_certificate");
var iframe = iframes[iframes.length - 1];
iframe.setAttribute("class","hidden");
// create new iframe
var new_iframe = par.createElement("iframe_certificate");
new_iframe.setAttribute("name","iframe_certificate");
new_iframe.src = "index.php'.request_query_string("system/ajax/uploadcertifacte.php",$current_language, $db).'&sid='.$sid.'";
new_iframe.frameBorder = "0";
par.getElementById("iframe_container_certificate").appendChild(new_iframe);
var par = window.parent.document; //hide old iframe var iframes = par.getElementsByName("iframe_certificate"); var iframe = iframes[iframes.length - 1]; iframe.setAttribute("class","hidden"); // create new iframe var new_iframe = par.createElement("iframe_certificate"); new_iframe.setAttribute("name","iframe_certificate"); new_iframe.src = "index.php'.request_query_string("system/ajax/uploadcertifacte.php",$current_language, $db).'&sid='.$sid.'"; new_iframe.frameBorder = "0"; par.getElementById("iframe_container_certificate").appendChild(new_iframe);
<div id="iframe_container_certificate">
<iframe name="iframe_certificate" src="index.php'.request_query_string("system/ajax/uploadcertificate.php",$current_language, $db).'&sid='.$certificate_picture.'" frameborder="0"></iframe>
</div>
<div id="iframe_container_certificate"> <iframe name="iframe_certificate" src="index.php'.request_query_string("system/ajax/uploadcertificate.php",$current_language, $db).'&sid='.$certificate_picture.'" frameborder="0"></iframe>
Hoplijk kan ziet iemand mijn fout staan.
|