누군가이 jQuery bit.ly URL 단축키를 도와 주시겠습니까?jQuery URL bit.ly 단축키 도움을 받으십시오.
function shortenUrl(urlMatch)
{
var urlMatch = urlMatch
var username="myusername";
var key = 'R_897b82b73568ea74fffbafa5a7b846d';
$.ajax({
url:"http://api.bit.ly/v3/shorten",
data:{longUrl:urlMatch,apiKey:key,login:username},
dataType:"jsonp",
success:function(v)
{
var shortUrl=v.data.url;
return shortUrl;
}
});
}
$('button').click(function(){
var urlMatch = $(this).val();
var newUrl = shortenUrl(urlMatch);
$('#menu').html(newUrl);
});
을하고 난 스크립트를 실행할 때마다 콘솔에서이 코드를 반환합니다 :
jsonp1304728172115({ data : [ ] , "status_code" : 500, "status_txt": "missing_arg_uri"})
사람이 도와주세요 수를 다음과 같이 코드입니다.
누락 된 매개 변수 "형식"다음에 세미콜론을 누락 되었습니까? 여기 내 버전의 코드입니다 : http://stackoverflow.com/questions/1771397/jquery-on-the-fly-url-shortener/7005673#7005673 –