Questions tagged «bit.ly»

4
短URL服务如何工作?
TinyURL或Metamark等服务如何工作? 他们是否只是将微小的URL密钥与仅提供“ HTTP重定向”到原始URL的[虚拟?]网页相关联?还是还有更多“魔术”呢? [原始措辞]我经常使用URL缩短服务,例如TinyURL,Metamark等,但每次这样做,我都想知道这些服务的工作方式。他们是否创建了将重定向到另一个页面的新文件,还是使用了子域?

5
从XmlHttpRequest.responseJSON解析JSON
我正在尝试在JavaScript中解析bit.ly JSON响应。 我通过XmlHttpRequest获取JSON。 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) { var jsonResponse = req.responseJSON; var bitlyUrl = jsonResponse.results[url].shortUrl; } 我在Firefox插件中执行此操作。当我运行时,该行出现错误“ jsonResponse is undefined” var bitlyUrl …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.