Ver Mensaje Individual
  #2 (permalink)  
Antiguo 29/02/2012, 07:50
cronosmen
 
Fecha de Ingreso: junio-2008
Mensajes: 165
Antigüedad: 15 años, 11 meses
Puntos: 6
Respuesta: Cargar Mootools dinamicamente? google.load?

Lo conseguí, si alguien más le interesa lo hice así:

Código Javascript:
Ver original
  1. if (typeof window.MooTools === "undefined") {
  2.     var script_tag = document.createElement('script');
  3.     script_tag.setAttribute("type","text/javascript");
  4.     script_tag.setAttribute("src",
  5.       "https://ajax.googleapis.com/ajax/libs/mootools/1.4.1/mootools-yui-compressed.js")
  6.     document.getElementsByTagName("head")[0].appendChild(script_tag);
  7.    
  8.     var script2_tag = document.createElement('script');
  9.     script2_tag.setAttribute("type","text/javascript");
  10.     script2_tag.setAttribute("src",
  11.       "#statics#/js/mootools-more-1.4.0.1.js")
  12.     script2_tag.onload = main;
  13.     script2_tag.onreadystatechange = function () { // Same thing but for IE
  14.       if (this.readyState == 'complete' || this.readyState == 'loaded') main();
  15.     }
  16.     document.getElementsByTagName("head")[0].appendChild(script2_tag);
  17. } else {
  18.     main();
  19. }
Aclaro que además cargue el motools.mote..