something is not right
(事情不对)
Well, you are using jQuery to check for the presence of jQuery.
(好吧,您正在使用jQuery检查jQuery是否存在。)
If jQuery isn't loaded then $()
won't even run at all and your callback won't execute, unless you're using another library and that library happens to share the same $()
syntax.(如果未加载jQuery,则$()
甚至都不会运行,并且回调也不会执行,除非您使用的是另一个库,并且该库恰好共享相同的$()
语法。)
Remove your $(document).ready()
(use something like window.onload
instead):
(删除您的$(document).ready()
(改用window.onload
东西):)
window.onload = function() {
if (window.jQuery) {
// jQuery is loaded
alert("Yeah!");
} else {
// jQuery is not loaded
alert("Doesn't Work");
}
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…