且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

我可以在另一个setTimeout中有一个setTimeout吗?

更新时间:2023-01-08 15:54:41

在你破碎的例子中 http://jsfiddle.net/wH2qF/ 有一些问题

In your broken example http://jsfiddle.net/wH2qF/ there are a few problems


  • 你忘了告诉jsfiddle使用jQuery

  • 卷跨度的id(在JS中)是 ph 但应该是 volumeNumber (如在HTML中)

  • You forgot to tell jsfiddle to use jQuery
  • The id of the volume span (in JS) was ph but should be volumeNumber (as in the HTML)

点击此处查看工作版本

您选择了jQuery吗?来自jsfiddle中的库,你会看到一个错误

Had you selected jQuery from the libraries in jsfiddle, you would have seen an error


未捕获TypeError:无法设置属性'innerHTML'为null

Uncaught TypeError: Cannot set property 'innerHTML' of null

这让我相信你的jsfiddle不能很好地代表你的问题。也许尝试创建另一个减少,因为你添加的只有愚蠢的错误?

That leads me to believe that your jsfiddle is not a good representation of your problem. Maybe try to create another reduction since the one you added only had "silly" errors?