Call: Copy code The code is as follows: <br>document.write(IPData.join(' ')) ; <br> The displayed result is: 202.105.128.73 Shenzhen City, Guangdong Province If no IP is required and only the region is required, the call is: Copy code The code is as follows: <br>document.write <br>(IPData[2]);document.write(IPData[3]); <br>< ;/script> <br> </div> <br>The displayed result is: <br>Shenzhen City, Guangdong Province<br>The above code also has a trick: UTF-8 page refers to the processing of JS file encoding with external encoding of GBK<br><a href="http://fw.qq.com/ipaddress">http://fw.qq.com/ipaddress</a>, and the js provided by this interface is GBK encoded. Since the page is UTF-8 encoded, the returned city name is used again on my page. The displayed code is garbled and cannot be quoted. Through the charset setting, the problem of garbled JavaScript files encoded as GBK is introduced in UTF-8 pages. And there is no need to write additional functions to process GBK to UTF-8 encoding. Similarly, if the JavaScript file referenced by the GBK page is encoded in UTF-8 encoding, there will be garbled problems. <br><br>Source: http://shanyou.cnblogs.com/