JQUERY get machine name or computer name jquery - Net-Raft.com

Welcome aboard! We are happy you are here and wish you good net-raft!




Together We Can Simplify The World
Just a Web Code Solution

How to get client machine name or computer name with jquery?


 4031

JQUERY


3

// you need to use javascript framework Node.js
// check out the code below

// try this ... this works
// at first you install "npm install --save path"

//put this code into app.js

var path = require('path');
var userName = process.env['USERPROFILE'].split(path.sep)[2];
var loginId = path.join("domainName",userName);
console.log(loginId);

// type "node app.js" in command prompt


By     Created   
The power of the user (%)
10%

JQUERY


2

// this is the complete code for javascript framework Node.js
// you can get domainName and computerName
// at first you install "npm install --save path"

//put this code into app.js

var path = require('path');
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);
console.log(loginId1);
console.log(loginId2);

// type "node app.js" in command prompt


By     Created   
The power of the user (%)
8%

JQUERY


1

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js "></script>
</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>


By     Created   
The power of the user (%)
3%

JQUERY


1

// this is the only solution, works only for IE in intranet or local machine, there is a security reason
// You get username or computer name via VBA or VB.NET (Environ$("username"),Environ$("computername")), but javascript, jquery ... all of client side is security reason

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');
}

});


By     Created   
The power of the user (%)
59%

JQUERY


1

// important : ActiveXObject works only for IE (new ActiveXObject("ADODB.Connection"))


By     Created   
The power of the user (%)
59%



The most helpful JQUERY solutions

plugin get client ip address using jqueryplugin get client ip address using jqueryJQUERY

Click to see more ...

  4.8K     1.3K

How to get client machine name or computer name with jquery?How to get client machine name or computer name with jquery?JQUERY

Click to see more ...

  4K     720

plugin detect country jqueryplugin detect country jqueryJQUERY

Click to see more ...

  1.9K     562

show position on google map jqueryshow position on google map jqueryJQUERY

Click to see more ...

  1.5K     387

cookie jquerycookie jqueryJQUERY

Click to see more ...

  1.4K     381

How to detect the version of IE browser using jquery ?How to detect the version of IE browser using jquery ?JQUERY

Click to see more ...

  1.1K     311

plugin convert thousands to K jqueryplugin convert thousands to K jqueryJQUERY

Click to see more ...

  797     258

How to get top, right, left, bottom position of element div using jquery ?How to get top, right, left, bottom position of element div using jquery ?JQUERY

Click to see more ...

  542     207

how to get ip address using jquery ?how to get ip address using jquery ?JQUERY

Click to see more ...

  511     193

how to create a jquery plugin for converting date to days ago, month ago and year ago ?how to create a jquery plugin for converting date to days ago, month ago and year ago ?JQUERY

Click to see more ...

  459     189

Hi net-rafter,
create the complete solutions that will be
used by the developers from all around the world.

join us - click to create your account