0

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!"

Anas Abu Farraj
  • 1,540
  • 4
  • 23
  • 31
Kilo
  • 9
  • 4

1 Answers1

0

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

zygimantus
  • 3,649
  • 4
  • 39
  • 54
  • function getUsername() { var username = $.session.getUsername(); return username; } var appuser = getUsername(); – Kilo Jan 06 '21 at 05:48