How to get the current user in HTML?

495 Views Asked by At

I have user.xsjs file which has the following code

var name1 = $.response.setBody($.session.getUsername());

I have test.html file I want to get the current user from user.xsjs file or aforesaid code directly used in test.html file to the get current user.

Need to get "Welcome CurrentUser!"

1

There are 1 best solutions below

1
On

You can add a <script> tag in which you can make an ajax call to user.xsjs file and then output response to HTML.