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;
                        onFailure: function(t){
                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
To unsubscribe from this group, send email to
For more options, visit this group at

Reply via email to