Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

How to Find out username with ajax request?*

edited February 2011 in Vanilla 2.0 - 2.8
Just like the title says, I need to find out via an ajax request the username of the user (or without ajax, but with javascript).

I first thought that it would've been obvious that some general info (like username) is stored in the javascript gdn object, but apparently none such is

Therefore... any ideas on how to do it?


  • Are you writing you own plugin? if so.
    $this->SetDefinition('Username', $Session->Username);


    var Username = gdn.definition('Username');
  • ok, I've tried doing that in several places, but everywhere it gave me an no method error... where exactly should I put that setDefinition in the plugin definition?
  • Sorry the method is $Sender->AddDefinition()
Sign In or Register to comment.