JavaScript was originally developed by Netscape and is supported by most browsers. The majority of Internet users still use Microsoft's Internet Explorer as their main browser and has JavaScript enabled. Some users may disable JavaScript to block popup ads, but browsers have now added popup blockers, so users no longer need to disable JavaScript. Because JavaScript is a client-side scripting language, it runs on the user's computer which can save bandwidth and load time in comparison with server-side scripts.
JavaScript can be used to validate form information, before sending the information to a database. This is useful to be certain that visitors fill in all required form fields (boxes of information). JavaScript can be used for drop-down menus, real-time clock displays, mouseover effects and much more.
Many popular browsers have reporting tools to report JavaScript errors. For example, Firefox Web Developer has the Error Console which can report errors on web or local documents. Recent versions of Opera have Dragonfly: go to Tools > Advanced > Developer Tools to use it. There is an online tool called Lint where you can copy and paste your source code and see reported JavaScript errors. You can download Lint software for Windows or Mac to test scripts locally.
Advanced JavaScript is often used with AJAX (Asynchronous JavaScript and XML) which is supported slightly differently in IE than it is Safari, Opera and Mozilla-based browsers like Firefox. There are numerous JavaScript frameworks to help make their scripts more cross-browser compatible. The more popular JavaScript frameworks include Dojo, Ext JS (read license before using), JQuery, , Mootools, Prototype, Sarissa and Spry. Programmers should test scripts in the most popular browsers and hope they work in all of them. Not all browsers are compatible or compliant with w3c or ECMA standards and a script may work in one and not another. For example, JavaScript arrays have been handled differently, so JavaScripts that work in Internet Explorer and Firefox may not work in Safari or Opera. Unless/until browsers comply with web standards for cross-browser compatibility, programmers will continue to test in various browsers and find surprises.
JavaScript is NOT recommended for mobile web sites.
© 2001-2010, Power Pages Web Design. All rights reserved.