First, events are bits of code that link an action by a user, to an action performed by the computer. The action can be a mouse action or key press on the keyboard, or even loading / unloading a webpage.
There a numerous events that can be used within your Web Page, it's just where you would use them varies from place to place. Below are the different categories of events you will use:
Now we will go a bit more in depth of each category, describe them and also provide a list of some of the most commonly used events.
Whenever a user performs actions with the mouse, these are the events that will detect the specific actions, and then you can act accordingly.
What occurs in the form above is that when you press the button (Press Me) once, the text box to the left (text1) will indicate you pressed the mouse button. And when you double-click the button, it will indicate the double-click.
These events detect when focus has been given to a certain control on a form.
Check out this code sample below. You can use it as a guide to give you an idea of how to work with these events.
Take a look at this code sample and see a few of the Miscellaneous Events in action.
This works the same with "onabort", "onunload" and so on.
In addition to the Misc., Keyboard, mouse and selection events, there are some window objects you can use to perform specific tasks. Below is a list of a few commonly used window objects you can use within your programs to make them more efficient and user friendly.
Check out the code below and you can get an idea of using these objects in your programs.
Take a look at the "open" button. You can open files or even urls. You can set the properties, they go like this: window.open('file or url', 'open it within the current window','set toolbar to yes or no, status bar yes or no, height and then width').
No Comments for this page.