누구든지이 코드의 문제점을 알 수 있습니까? 어떤 이유로 내 uiop
변수는jQuery 변수가 작동하지 않습니다.
$(document).ready(function() {
var siteUrlValue = 'http://www.dagbladet.no/';
console.group('Initializing Google URL Shortener API...');
$.urlShortener({
longUrl: siteUrlValue,
success: function (shortUrl) {
var gooGl = shortUrl;
console.info('The Short Url is: ' + gooGl);
console.groupEnd();
setTimeout(function() {
asdf();
}, 5000);
},
error: function (err) {
console.error(JSON.stringify(err));
console.groupEnd();
}
});
function asdf() {
var uiop = gooGl();
console.info('The Short Url is: ' + uiop);
}
});
탄원 당신은 Ajax 호출의 successfuntion의 내부 GOOGL를 선언 jSFiddle
'의 GOOGL을 (콘솔을 확인). –