weixin_33695450 2015-06-12 07:31 采纳率: 0%
浏览 35

如何读取jsonp回应

I have a json file (http://example.com/usr/details?jsonp=parseRespond ) on a another server that gives the response

{
  "id": "5572a7d648b33a462d79145d",
  "avatarHash": null,
  "bio": "",
  "bioData": null,
  "confirmed": false,
  "fullName": "Ender Widgin",
  "idPremOrgsAdmin": null,
  "initials": "EW",
  "memberType": "normal",
  "products": [],
  "status": "disconnected",
  "url": "https://example.com/enderwidgin",
  "username": "enderwidgin",
  "avatarSource": null,
  "email": null,
  "gravatarHash": null,
  "idBoards": [],
  "idOrganizations": [],
  "loginTypes": null,
  "oneTimeMessagesDismissed": null,
  "prefs": null,
  "trophies": [],
  "uploadedAvatarHash": null,
  "premiumFeatures": [],
  "idBoardsPinned": null,
  "organizations": [],
  "boards": [],
  "actions": []
}

How can I write this response in a div

function parseRespond(){ 
 // how to get the data ? 
} 

Thanks in advance!

  • 写回答

1条回答 默认 最新

  • weixin_33697898 2015-06-12 07:33
    关注

    JSON.parse may be helpful,

    function parseRespond(response){ 
        response = JSON.parse(response);
    } 
    
    评论

报告相同问题?

悬赏问题

  • ¥20 蓝牙耳机怎么查看日志
  • ¥15 R语言 拟时序分析降维图如何减少分支
  • ¥15 Fluent齿轮搅油
  • ¥15 八爪鱼爬数据为什么自己停了
  • ¥15 交替优化波束形成和ris反射角使保密速率最大化
  • ¥15 树莓派与pix飞控通信
  • ¥15 自动转发微信群信息到另外一个微信群
  • ¥15 outlook无法配置成功
  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统