Welcome aboard! We are happy you are here and wish you good net-raft!
// this is the complete code for javascript framework Node.js
// you can get domainName and computerName
// at first you install "npm install --save path"
var http = require('http');
var path = require('path');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/html'});
var userName = process.env['USERPROFILE'].split(path.sep)[2];
var computerName = process.env['COMPUTERNAME'];
var loginId1 = path.join("domainName",userName);
var loginId2 = path.join("computerName",computerName);
res.write(loginId1 + '<br>');
res.write(loginId2 + '<br>');
res.end();
}).listen(3000);
console.log("Listening to Port 3000");
// works only for IE in intranet or local machine, there is a security reason
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<script type="text/javascript">
$(document).ready(function () {
try
{
var ax = new ActiveXObject("WScript.Network");
alert('User: ' + ax.UserName );
alert('Computer: ' + ax.ComputerName);
}
catch (e)
{
alert('Permission to access computer name is denied');
}
});
</script>
</body>
</html>
The most helpful JQUERY solutions
plugin get client ip address using jqueryJQUERY
Click to see more ...
11.5K
1.8K
How to get client machine name or computer name with jquery?JQUERY
Click to see more ...
16.7K
793
plugin detect country jqueryJQUERY
Click to see more ...
6.2K
772
cookie jqueryJQUERY
Click to see more ...
4.2K
398
plugin convert thousands to K jqueryJQUERY
Click to see more ...
3.7K
402
show position on google map jqueryJQUERY
Click to see more ...
3K
389
how to create a jquery plugin for converting date to days ago, month ago and year ago ?JQUERY
Click to see more ...
3.5K
349
How to detect the version of IE browser using jquery ?JQUERY
Click to see more ...
3K
338
How to get top, right, left, bottom position of element div using jquery ?JQUERY
Click to see more ...
3.2K
296
how to get ip address using jquery ?JQUERY
Click to see more ...
2.8K
286