Good and Bad Events
-
onLoad - in the <body> tag.
-
Popup windows when the page has finised loading.
-
Has a good purpose: can be used on pages that take a long time to load.
-
onUnload - used with window.open to make revenue for not-so-nice
websites.
And some better events...
-
onError - Use when an error occurs.
-
onChange - Use when a text field is changed. Key for validation!
-
onSubmit - when a form is submitted.
-
Return true to allow submission, false to stop.
Example Revisited
Lab
Home
Internet II: Day 4