Timing of events and identification of browsers
As our knowledge of JavaScript becomes increasingly rich, we can program increasingly complex applications. In the last course we learned how to write Cookies using JavaScripts. Today we will learn how to add a timing function. The ability to time events is very useful in browsers, but even more so in dynamic HTML applications.
You may notice that dynamic HTML can move different content around the page. Moving an object on the screen in JavaScript requires the use of a loop, and the loop function is used to make the object move over time. But how do you tell JavaScript to move an object a little bit every second or every tenth of a second?
However, the ability to move an object varies greatly in different browsers. To apply dynamic HTML in different browsers, you need to do some special processing. So after explaining event timing, I will explain how to identify which browser the user is using (you can use different program codes for different browsers).
First learn the timing of events. Click the button below and a prompt box will pop up after 3 seconds.