Hi  all ,
i want to get the user name inside the
clientReady = function()

my problem is ,
this.core.user.properties
this.user.properties
APE.user.properties

nothing works :( always it says similar

uncaught exception: [Exception... "'TypeError: this.core.user is
undefined' when calling method: [nsIDOMEventListener::handleEvent]"
nsresult: "0x8057001c (NS_ERROR_XPC_JS_THREW_JS_OBJECT)" location: "JS
frame :: chrome://firebug/content/net/spy.js :: callPageHandler ::
line 817" data: no]

i saw how to save the username in options , but i only want the name
of the user to check on mysql for it.
but dont know how to get the user inside this function

//1) Create Tourney class and make it inherit from APE.Client
var Tourney = function () {
    //Load APE Core
    this.load();
    //call initEvents to handle events
    this.initEvents();
}

Tourney.prototype = new APE.Client;
.
.
.

Tourney.prototype.clientReady = function() {
    //This function is empty for now, we will fill it in the next part
of this tutorial
        console.log('ready Event');
                        // username
                        // console.log(APE.core.user.pubid); //Show pubid of 
current user
                        // console.log(APE.core.user.properties); //Show 
properties of
current user
                        //console.log(this.core.user.pubid); //Show pubid of 
current user
                        console.log(this.core.user.properties); //Show 
properties of
current user
                        var uname = 'efyx'; //this.user.properties.name;
                        console.log('name:'+uname);
           //sende getInfo Kommando
            this.core.request.send('getInfo', {'user':uname});

            //////////////////////////////////////
            // EDIT: by shaggy [05-Jul-2011]:
            //  Cannot call variable 'params' not defined yet, commented out.
            //  This will work after the "onRaw info callback".
            //      console.log('efyx: '+params.data.age
+'-'+params.data.city);
            //////////////////////////////////////

            //onRaw info callback
            this.onRaw('info', function(params) {

                    //////////////////////////////////////
                    // EDIT: by shaggy [05-Jul-2011]:
                    //  Variable 'params' can now be accessed.
                        console.log(uname+': '+params.data.age
+'-'+params.data.city);
                    //////////////////////////////////////

                console.log(params);// Log Parameter ind der
Entwicklerkonsole
                                alert("Age : "+params.data.age+" City: 
"+params.data.city);
                                this.core.join('testChannel');
            });

}
.
.
.

-- 
You received this message because you are subscribed to the Google
Groups "APE Project" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/ape-project?hl=en
---
APE Project (Ajax Push Engine)
Official website : http://www.ape-project.org/
Git Hub : http://github.com/APE-Project/

Reply via email to