5
Phân tích cú pháp JSON từ XmlHttpRequest.responseJSON
Tôi đang cố gắng phân tích cú pháp phản hồi JSON bit.ly trong javascript. Tôi lấy JSON qua XmlHttpRequest. var req = new XMLHttpRequest; req.overrideMimeType("application/json"); req.open('GET', BITLY_CREATE_API + encodeURIComponent(url) + BITLY_API_LOGIN, true); var target = this; req.onload = function() {target.parseJSON(req, url)}; req.send(null); parseJSON: function(req, url) { if (req.status == 200) …