gpt4 book ai didi

javascript - 互联网浏览器中的enhance.js错误

转载 作者:行者123 更新时间:2023-12-02 20:25:15 24 4
gpt4 key购买 nike

我正在尝试使用enhance.js 仅在桌面上加载脚本:

http://dl.dropbox.com/u/426954/allora/index.html

<script>
enhance({
loadScripts: [
{media: 'screen', excludemedia: 'screen and (max-device-width: 480px)', src: 'js/jquery-1.5.min.js'},
{media: 'screen', excludemedia: 'screen and (max-device-width: 480px)', src: 'js/jquery.cycle.lite.min.js'},
{media: 'screen', excludemedia: 'screen and (max-device-width: 480px)', src: 'js/script.js'},
]
});
</script>

但我在 Internet Explorer 8 中收到此错误:

网页错误详细信息

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E; Media Center PC 6.0) Timestamp: Sun, 6 Feb 2011 13:05:48 UTC

Message: 'media' is null or not an object Line: 7 Char: 8741 Code: 0 URI: http://dl.dropbox.com/u/426954/allora/js/enhance.min.js

感谢您的建议

最佳答案

你多了一个逗号。

IE 7 和 8 认为数组中会有一个额外的未定义元素。

旁注:IE6会出现语法错误,其他浏览器会忽略它

关于javascript - 互联网浏览器中的enhance.js错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4932215/

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