{{velocity}}
#set( $foo = $xwiki.getUserName(“XWiki.$xcontext.getUser()”,false))
Hello $foo World!
$xcontext.put(“name”, $foo)
{{/velocity}}
###/script type=“text/javascript”>
var myvar = “${name}”;
alert ($name);
</script/
I need username for verification purpose. I am unable to fetch username in javascript. Please help me out with this.