【发布时间】:2026-02-15 15:45:02
【问题描述】:
我使用 Adobe Edge 已经有一段时间了,我还想使用 Preloader 通过 AJAX 为我的合成加载数据。为此,我在 Preloader>loading-Event 中创建了以下代码。哪个事件有点问题,因为根本没有文档,所以我一点也不知道它何时被触发。
// this little fella is fetching url-
// parameters and puts them in a var called GET
(function () {
window.GET = {};
var s = window.location.search.substring(1).split('&');
if (!s.length) return;
for (var i = 0; i < s.length; i++) {
var parts = s[i].split('=');
window.GET[unescape(parts[0])] = unescape(parts[1]);
}
}())
var playlist = GET["l"],
playlistLoadSuccessHandler = function (data, status, xhr) {
console.log(data);
};
$.ajax({
url: playlist,
dataType: 'xml',
success: playlistLoadSuccessHandler
});
所以我得到的只是:Uncaught ReferenceError: $ is not defined
有没有人比我在 Adobe Edge 方面的经验多一点并且知道我的错误是什么?
【问题讨论】:
-
你在哪里加载 jQuery?
-
它应该在我的代码执行时由边缘运行时实现。如果我打印“this” inb4 我的代码,我可以看到 $ 存在并且用 jquery 正确填充。
-
如果已加载 jQuery,请尝试 jQuery.ajax({ 因为您可能没有定义 $
-
我阅读了几个关于在预加载器中使用 jquery 的示例,所有这些示例都引用了 - 像往常一样 - jquery with $
-
啊,我的错。不熟悉 Adobe-Edge
标签: javascript jquery adobe-edge