People: i had been searching the web to find some way to load a piece of javascript code on demand. So far the only method thats works is
var ServerObject = Class.create({ initialize: function() { this.the_script = ""; new Ajax.Request(arguments[0], { contentType: "text/javascript", asynchronous: false, onSuccess: function(t) { var j = new Element('script', { type: "text/javascript", language: "javascript" }); j.innerHTML = this.the_script; document.body.appendChild(j); //eval(t.responseText); }, onFailure: function(t){ alert(t.responseText); } }); return eval(this.el_script); } }); This works only on mozilla. I canĀ“t find a way to make a method or function well. (cross browser an clean) Thanks, and sory about my english is quite forgotted. Federico Ciliberti. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Prototype: Core" group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~----------~----~----~----~------~----~------~--~---