我只是想进行一个简单的 ajax 调用来使用谷歌的 url 缩短器来缩短一个 url,但它没有返回任何数据。有人有想法么?
$.ajax({
type: 'POST',
url: "https://www.googleapis.com/urlshortener/v1/url",
contentType: 'application/json',
data: {longUrl: match},
dataType: 'json',
success: function(id){
$('#menu').html(id);
}
});
我有一个 API 密钥,但我没有把它放在这里。而且您不需要使用该服务。