7 methods for obtaining client IP addresses, MAC addresses, and host names in JS _ javascript tips

Source: Internet
Author: User
Tags get ip
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:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.