"this.core.user.properties.name" should work, I guess.
I suggest you use console in chrome browser, and dump the object to see its
structure so that you know the exact property to call.
Like, if the APE client in your javascript code is defined as:
var client = new APE.Client();
then dump its data via console:
console.log(client)
On Wednesday, June 20, 2012 1:28:20 AM UTC+5:30, RakonDark wrote:
>
> 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/