Code Examples - JavaScript
This section contains example codes for JavaScript. JavaScript is client side code which can make pages dynamic, ie. it's event driven. JavaScripts always need to be thoroughly checked in different browsers (Internet Explorer, Firefox, Opera, Safari, etc.) and in the different versions as each browser handles JavaScript differently. Also take in account that some users (<10%) have JavaScript disabled.
Examples:- Format a field when it receives focus
- Give a form field focus on page load
- Have a page break out of a containing frameset
- Open link without adding to browser history
- Open link by click on area containing the link
- Display a dynamically updated clock on the page
- Preload images
- Validate value as numeric value
- Switch field focus when maxlength of field is reached