Issue
I was wondering how I would get the name of the current user in JavaScript as part of an HTML document.
In Java, one would type System.getProperty("user.name");
to achieve this. What is the alternative to this in JavaScript?
Solution
JavaScript runs in the context of the current HTML document, so it won't be able to determine anything about a current user unless it's in the current page or you do AJAX calls to a server-side script to get more information.
JavaScript will not be able to determine your Windows user name.
Answered By - Surreal Dreams
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.