目前百度的ip api返回的是
- {
- "status": "0",
- "t": "",
- "set_cache_time": "",
- "data": [
- {
- "ExtendedLocation": "",
- "OriginQuery": "114.114.114.114",
- "appinfo": "",
- "disp_type": 0,
- "fetchkey": "114.114.114.114",
- "location": "江苏省南京市 电信",
- "origip": "114.114.114.114",
- "origipquery": "114.114.114.114",
- "resourceid": "6006",
- "role_id": 0,
- "shareImage": 1,
- "showLikeShare": 1,
- "showlamp": "1",
- "titlecont": "IP地址查询",
- "tplt": "ip"
- }
- ]
- }
复制代码
使用
- $.getScript(‘https://sp0.baidu.com/8aQDcjqpAAV3otqbppnN2DJv/api.php?query=114.114.114.114&co=&resource_id=6006’,function(){
- $(".city").html(.location);
- });
复制代码
返回不到地址位置
应该是
- $(".city").html(.location);
复制代码
写错了 因为怎么写呢 |