This article mainly introduces seven methods for JS to obtain Client IP addresses, MAC addresses, and host names. JS itself does not support obtaining IP addresses and other information. This article uses other methods to achieve this, if you need a friend, you can refer to the small program that is engaged in JS (javascript) to obtain the Client IP address today. After searching the Internet, many of them are ineffective in the current system and browser, and they are helpless, in Chrome and FireFox, JavaScript scripts such as obtaining IP addresses using ActiveX are rarely obtained. The following code passes all windows and later windows tests and provides the Code:
1. Several Methods for getting Client IP addresses using JS
Method 1 (for IE only and the client's IE allows AcitiveX to run, through the Platform: XP, SERVER03, 2000 ).
Get Client IP code:
The Code is as follows:
GetLocalIP
Get IP: