Hi,

I'm a problem with this code.

////////////////////////////////////////////////////////////////////
var test = Class.create({
        val:null,
        initialize:function(val) {
                //obligatoire pour fonctionner
                this.val = val;
                new Ajax.Request("file.html", {
                        method: 'POST',
                        evalScripts: true,
                        onSuccess: function(result) {
                                alert("1 "+this.val); // => return 'undefined' 
=> doesn't work?
why?
                                alert("2 "+val); // => 'test', reference of
initialize:function(val) => ok
                                this.func2(); // => doesn't work? why?
                        }
                });
        }
        func2:function() {
                alert("1 "+this.val); // => return 'test' => ok
        }
});
new test("test");
////////////////////////////////////////////////////////////////////

So, i don't understand why i can't get the value of "val" all the time
and in all function of the class.

Thank you for your help.

Yohann POLI

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to