0

我正在开发一个由其他人开发的网站。主页 (index.php) 运行 Google Announce 脚本 - gAnnounce.js。

该网站的所有者报告说该脚本“突然无法在 IE8 中运行”。该脚本适用于我尝试过的所有其他浏览器。但它在 IE8 中不起作用。

这是我在 IE8 中测试时收到的错误;

*此页面上的脚本出现错误。行:14 字符:1 错误:'v_content[...].0' 为空或不是对象代码:0 URL:http ://teleco4.com/js/gAnnounce.js *

该网站的所有者发誓它以前工作过。

有没有人对此公告滚动脚本问题有任何见解或经验?

在此先感谢大家。

iogen70

4

1 回答 1

0

查看正在使用此脚本的页面,即teleco4.com,您的问题似乎在于第 401 行v_content的数组终止。问题不在gAnnounce.js脚本中。这是您的代码的相关部分:

v_content=[['','\"Without the helpful, knowledgeable people at Teleco,
I would be lost.\" <br> <strong>Carol Coote, NYC Law
Department</strong>',''],['','\"Bravo Teleco. They did a great job for
us, with good communications and stayed until problem fixed. Thanks.\"
<br> <strong>Jay Brill ABC Training Center</strong>',''],['','\"Your
response time was remarkable – as was the good service – with NO down
time whatsoever,\" <br> <strong>Scott Rovner Vendor Lease Management
Group</strong>',''],]

注意最后声明的嵌套数组后面的附加逗号?!删除那个逗号,你应该没问题。当数组未正确终止时,似乎 IE 有问题。您的代码应该是:

v_content=[['','\"Without the helpful, knowledgeable people at Teleco,
I would be lost.\" <br> <strong>Carol Coote, NYC Law
Department</strong>',''],['','\"Bravo Teleco. They did a great job for
us, with good communications and stayed until problem fixed. Thanks.\"
<br> <strong>Jay Brill ABC Training Center</strong>',''],['','\"Your
response time was remarkable – as was the good service – with NO down
time whatsoever,\" <br> <strong>Scott Rovner Vendor Lease Management
Group</strong>','']]

我已经在本地测试了这个解决方案,它确实在 Internet Explorer 8 中开始正常工作。请自己查看:http: //jsfiddle.net/2rZb5/

干杯!

于 2013-01-26T18:20:30.013 回答