function showvideo(id){ var url="/videos/exec/get_galvideo.php?id="+id; crear_script_tag_video(url); } function crear_script_tag_video(arch){ var sc_obj="JS_SCRIPT_OBJECT"; var obj_head = document.getElementsByTagName("head").item(0) scriptTag = document.getElementById(sc_obj); if(scriptTag!=null) { obj_head.removeChild(scriptTag); delete scriptTag; scriptTag=null; } scriptTag = document.createElement("SCRIPT"); var vch="?"; if (arch.indexOf("?")!=-1) vch="&"; scriptTag.src = arch+vch+Math.random()*1000000; scriptTag.type = 'text/javascript'; scriptTag.id = sc_obj; obj_head.appendChild(scriptTag); }