O'Reilly logo

The Book of JavaScript, 2nd Edition by thau!

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How the Book of JavaScript Tip Box Works

The Book of JavaScript website has a little textarea that shows various programming tips. The script keeps these tips in an array and then uses JavaScript to loop through the array, showing one tip at a time. Each tip stays in the textarea for 3.5 seconds before the next one appears. I should confess that I got the idea for this tip box from something that the search engine ask.com (http://www.ask.com, formerly known as Ask Jeeves) once had on its home page. In fact, I will present two different versions of the code. The first version, shown in Figure 8-13, is very similar to the code Ask.com originally used. The second version, which you'll see in Figure 8-14, is a bit simpler (though not necessarily better). ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required