引用JS绝对路径获取ip地址: 绝对路径: http://pv.sohu.com/cityjson?ie=utf-8/demo.js 在事件中定义ip值即可: var com_ip=returnCitySN["cip"]