var width = '480' ; var height = '550' ; var site = 'site'; var path = 'http://www.sortiescinema.net/l_age_de_raison/jeu'; var cf_script = document.getElementsByTagName("script"); var cf_parent; for(var i=0; i < cf_script.length; i++) { if( cf_script[i].getAttribute('src')) { if(cf_script[i].getAttribute('src').indexOf("widget") != -1) { cf_parent = cf_script[i].parentNode; } } } var div = document.createElement('div'); div.setAttribute('id', 'cfdivbox'); var iframe = document.createElement('iframe'); iframe.setAttribute('src', path + '/jeu.php?height=' + height + '&width=' + width + '&site=' + site); iframe.setAttribute('frameborder', '0'); iframe.setAttribute('border', '0'); iframe.setAttribute('scrolling', 'no'); iframe.setAttribute('style', 'width:' + width + 'px; height:' + height + 'px;border: solid #FFFF00 0px;'); iframe.style.width = width + 'px'; iframe.style.height = height + 'px'; div.appendChild(iframe); cf_parent.appendChild(div);