JavaScript代码从google api获得goo.gl的短地址
<script type="text/javascript"> function getShortUrl(url) { var tdata = '{"longUrl": "' + url + '"}'; $.support.cors = true; $.ajax({ url: "https://www.useso.com/urlshortener/v1/url", type: "POST", dataType: "json", data: tdata, contentType: "application/json", success: function (result) { var shortUrl = result.id; console.log(result); }, error : function(request,status,error) { //console.log("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+error); } }); } getShortUrl('http://www.75271.com'); </script>