gpt4 book ai didi

javascript - Internet Explorer 8 中的 jQuery 问题

转载 作者:IT王子 更新时间:2023-10-29 02:47:53 26 4
gpt4 key购买 nike

我正在尝试让我的 jQuery 函数在 IE8 上运行。我正在从 Google 的服务器 ( http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js ) 加载库。

$(function(){}) 永远不会被调用。相反,我收到错误 Object expected。我打开开发人员并在控制台中运行 typeof $,结果显示为 undefined

我已经尝试访问我知道使用 jQuery 的其他网站 (jquery.com),并且这些网站都有效,这里有什么我可能遗漏的吗?

最佳答案

定义变量时,在变量前写“var”。当没有“var”时,IE8 就死了。

关于javascript - Internet Explorer 8 中的 jQuery 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/879137/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com