Get nick from jid

Hi everyone,

I’m working with sparkweb.js api and I have a little issue.

How can I get the user’s nick from a jid???

var jid=XMPP.JID (myjid);

var name=jid.???

Is this the correct way?

Thanks in advance