Home >Web Front-end >JS Tutorial >JavaScript Advanced Tutorial (Lesson 3) Page 1/2_Basic Knowledge

JavaScript Advanced Tutorial (Lesson 3) Page 1/2_Basic Knowledge

PHP中文网
PHP中文网Original
2016-05-16 19:15:32756browse

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.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn