Home > Web Front-end > JS Tutorial > fw.qq.com/ipaddress has expired. New method of obtaining client IP using javascript_javascript skills

fw.qq.com/ipaddress has expired. New method of obtaining client IP using javascript_javascript skills

WBOY
Release: 2016-05-16 17:57:22
Original
1177 people have browsed it

The way we call it is . It can return the user IP and address, for example: var IPData = new Array("220.181.108.85","","Beijing",""); We can then use IPData[0] as the user IP.

But I don’t know what happened to Tencent recently. This address has become invalid, prompting "HTTP 500 Internal Server Error".

Another way to get the client IP using JavaScript

Recently, I discovered another way to get the client IP. This service is provided by a foreign website. How to use:


[Ctrl A Select all Note:
If you need to introduce external Js, you need to refresh to execute it
]

What is shown below is yours IP:

You are visiting from:
IP Address: 117.87.4.102
Host: 102.4.87.117.broad.xz.js.dynamic.163data.com.cn

If you don’t want to display it on the web page, but just want to obtain the IP for other purposes, then you need to change VIH_DisplayOnPage = "yes" to VIH_DisplayOnPage = "no". The IP variable is VIH_HostIP. The calling method is as follows:
[Ctrl A select all Note: If you need to introduce external Js, you need to refresh to execute ]
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template