This article describes how JS simply obtains the client IP address. Share it for your reference, as follows:
<!doctype html><html><head><meta charset="utf-8"><title>Use Sohu interface to obtain the client IP address</title></head><body><script src="http://pv.sohu.com/cityjson?ie=utf-8"></script><script type="text/javascript">document.write(returnCitySN["cip"]+','+returnCitySN["cname"])</script></body></html>
Reproduction image:
For more information about JavaScript related content, please check out the topics of this site: "Summary of JavaScript Search Algorithm Skills", "Summary of JavaScript Data Structure and Algorithm Skills", "Summary of JavaScript traversal algorithms and techniques", "Summary of json operation techniques in JavaScript", "Summary of JavaScript switching effects and techniques", "Summary of JavaScript animation effects and techniques", "Summary of JavaScript errors and debugging techniques" and "Summary of JavaScript mathematical operations usage"
I hope this article will be helpful to everyone's JavaScript programming.