Ver Mensaje Individual
  #2 (permalink)  
Antiguo 18/08/2005, 20:40
Avatar de derkenuke
derkenuke
Colaborador
 
Fecha de Ingreso: octubre-2003
Ubicación: self.location.href
Mensajes: 2.665
Antigüedad: 21 años, 4 meses
Puntos: 45
Supongo que en el body tampoco te importará:

CODIGO uno.js:
Código PHP:
alert("importado 1!"); 
CODIGO dos.js:
Código PHP:
alert("importado 2!"); 
CODIGO index.htm:
Código PHP:
<html><head></head><body>

<
script>

function 
importar(rutaJS) {
    var 
scr=document.createElement("SCRIPT");
    
scr.setAttribute("src"rutaJS);
    
scr.setAttribute("type""text/javascript");
    
document.body.appendChild(scr);
}

</script>

<input type="button" value="importa el 1" onclick="importar('uno.js')" /> <br />
<input type="button" value="importa el 2" onclick="importar('dos.js')" /> <br />



</body></html> 
Compruebalo tu mismo. Funciona!

__________________
- Haz preguntas inteligentes, y obtendrás más y mejores respuestas.
- Antes de postearlo Inténtalo y Búscalo.
- Escribe correctamente tus mensajes.