jquery prepend在除IE7之外的所有borwsers中工作

Arrg! 到目前为止,我的网站(正在进行中)在我测试过的所有浏览器(firefox,safari,chrome和IE8)中都运行良好,但在IE7中却没有(我不知道IE6或其他浏览器)….我我不是肯定的,但我认为这个问题与我在jQuery中使用prepend()有关。 主要问题是主菜单(应显示在徽标左侧的蓝色水平栏中)以及右上角的搜索框,两者都使用前置添加。 在IE7中还有其他问题,所以我不确定我是否正在考虑它是否来自jQuery,或者在我当前的CSS混乱中是否存在拼写错误!

这是我用于主菜单的脚本,它在IE7中不起作用,但在其他浏览器中有效 – 有没有人在这里看到问题?

 <!-- $(function() { /* ************************************** */ /* main menu */ /* ************************************** */ $("#bannerAreaWrapper").prepend(""); }); -->  

这是该网站的链接: http : //www.agencydr.squarespace.com帮助表示赞赏!!

当我通过IE7上的开发工具栏脚本控制台运行它时,你的prepend函数工作正常,虽然它在加载时不起作用。 IE8上有一个js错误,IE7上有两个错误。 IE7上的附加function与此function有关:

 $('#LocationsMapWrapper').hover(function() { $('#LocationsMapWrapper #MapImage').animate({ width: 600, height: 375, marginLeft: 550, marginTop: -20, }, "slow", "easeOutQuad"); } 

第139行具体而言

尝试删除它,看看导航是否在页面加载时按预期工作

编辑

砰的一声,得到了它。

尝试删除’marginTop:-20’之后的逗号,最后一个元素不应该有这个,认为它会影响所有旧浏览器

IE7在您的网站中发现两个javascript错误:

 Expected identifier, string or number line 139 $('#LocationsMapWrapper').hover(function() { $('#LocationsMapWrapper #MapImage').animate({ width: 600, height: 375, marginLeft: 550, marginTop: -20, <---- remove comma }, "slow", "easeOutQuad"); } 'document.getElementById(...)' is null or not an object line 355 Shadowbox.setup(document.getElementById('Map').getElementsByTagName('area'), {width : 450, height : 400});