Correct syntax of javascript setinterval

Source: Internet
Author: User

I used setinterval to write a small program a few days ago. I will not explain what setinterval is used.


The writing method can be used in other browsers. Later, the test team's colleagues took a test and the problem occurred. Because they love 360 and Internet Explorer. I was puzzled within two days. IE always reported that the method parameter was incorrect. Later I reported that the method could not be found, and finally I found the problem!


However, I really want to express my dissatisfaction. The problem is that there are too many copies on the Internet, which leads to many mistakes, such


SetInterval (QuoteList ('parameter'), 3000 );

And even

SetInterval (QuoteList, 3000, 'parameter ');


I have to mention the fault tolerance ability of various browsers, especially Firefox and aoyou. These error scripts actually know that you are wrong, but you can understand what you mean, so there is no error in running. But IE won't !! It doesn't know at all!

Because the correct syntax is:


SetInterval ("QuoteList ('parameter')", 3000 );


This problem has plagued me for several days and I still thought it was a browser compatibility problem!


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.