gpt4 book ai didi

Javascript 在 IE 中不起作用,但所有其他浏览器都工作正常

转载 作者:行者123 更新时间:2023-11-28 12:43:15 24 4
gpt4 key购买 nike

我的主页上有一些推荐,代码似乎在 Firefox、Chrome 和 Safari 中工作得很好,但在 IExplorer 中却不行。我正在运行 IE 9。如果有任何帮助或见解,我将不胜感激。

这是我正在使用的代码:

<div class="quotes">
<div id="tst">
<div id="quote"></div>
</div>
<br><span></span>
</div>
<div class="comment"><strong>
<div id="tstperson"></div></strong>
</div>
<script type="text/javascript">
var quote=new Array();
quote[0]="An essential tool in preparation for any show. Valuable time is saved, refining vocals much earlier in the process.";
quote[1]="Invaluable for learning vocal lines! A brilliantly simple and easy to use interface that saved me hours of time.";
quote[2]="MixMyPart saved us almost a week of rehersal time. A brilliant invention. Singers come in less nervous and more focused.";
<!-- quote[3]="An invaluble tool for learning vocal lines! Brilliantly simple and easy to use interface that saved me hours of time.";
-->

var quoteperson=new Array();
quoteperson[0]="Bob Foster, <font color=\"ffffff\">Music Director</font>";
quoteperson[1]="Liam Tobin, <font color=\"ffffff\">Actor</font>";
quoteperson[2]="Shawn Wright, <font color=\"ffffff\">Actor</font>";
<!-- quoteperson[3]="Liam Tobin, <a href=\"website.html\" target=\"_blank\">website.org</a>";
-->

var speed=7000;
var q=Math.floor(Math.random()*quote.length)

function showQuote() {
document.getElementById("tst").innerHTML="&ldquo;"+quote[q]+"&rdquo;";
document.getElementById("tstperson").innerHTML=quoteperson[q];
q++;
if(q==quote.length) {
q=0;
}
}
showQuote();
setInterval('showQuote()',speed);
</script>

最佳答案

<!-- -->

不是有效的 JavaScript 注释。使用/* */代替。

关于Javascript 在 IE 中不起作用,但所有其他浏览器都工作正常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10692134/

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