gpt4 book ai didi

javascript/jquery 选项卡在 IE7、8 或 9 中不起作用

转载 作者:行者123 更新时间:2023-11-28 16:15:29 27 4
gpt4 key购买 nike

此代码适用于除 IE7、8 和 9 之外的所有浏览器。我知道我可以使用 jquery 选项卡,但我喜欢以不同的方式做事来学习更多 native JavaScript。在 IE 中打开 fiddle ,你就会明白我的意思。在任何其他浏览器中打开它,它就会起作用。有人请告诉我我做错了什么。谢谢

tab links fiddle

最佳答案

在 IE9 中,this.pathname 返回 _display/,但在 Chrome 中,它是 /_display/

在 IE9 和 Chrome 中,window.location.pathname 都是 /_display/

因此 this.pathname == window.location.pathname 在 IE 中失败。

更新的示例:http://jsfiddle.net/rL9Mj/1/

关于javascript/jquery 选项卡在 IE7、8 或 9 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11582878/

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