【发布时间】:2015-03-11 19:05:10
【问题描述】:
(
function restoreURL() {
function turnLongURL(data) {
window.location = data.url;
}
var shortUrl = window.location.href;
var url = "http://json-longurl.appspot.com/?url=" + shortUrl + "&callback=turnLongURL";
var script = document.createElement('script');
script.setAttribute('src', url);
document.getElementsByTagName('head')[0].appendChild(script);
})();
代码在上面,但 firebug 告诉我,turnLongURL 没有定义
这是为什么呢?
【问题讨论】:
标签: javascript jsonp