IE 7/8 / Chrome $(window).load问题

发布于 2024-09-08 11:45:24 字数 258 浏览 2 评论 0原文

我的网站在 mac ff/safari 上运行良好。在 pc ie 7/8 和 chrome 上,我收到一个错误 $ is not Defined ,涉及

$(window).load(function (){}

任何人都可以建议解决方法吗?我选择使用 window.(load) 而不是 (document).ready,因为我正在加载一些大的背景图像,并希望它们在开始时加载,而不是冒着稍后加载延迟的风险。

谢谢!

My site is runnin fine on mac ff/safari. On pc ie 7/8 and chrome I get an error $ is not defined relating to

$(window).load(function (){}

Can anyone suggest a workaround. I chose to use window.(load) over (document).ready as I am loading in some big background images and would like them to load at the start rather than risk loading delays later.

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

似梦非梦 2024-09-15 11:45:24
  • 确保 jQuery 已加载到您的页面上

    if(typeof jQuery === '未定义'){
        警报('没有 jQuery :(');
    }
    
  • 确保 $ 可用且分配正确

    <前><代码>(函数($){
    $(文档).ready(函数(){
    });
    })(jQuery);

  • make sure jQuery is loaded on your page

    if(typeof jQuery === 'undefined'){
        alert('no jQuery :(');
    }
    
  • make sure the $ is available and assigned correctly

    (function($){
        $(document).ready(function(){
        });
    })(jQuery);
    
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文