JavaScript is only one actor in a much bigger performance. It plays a role, but is dependent upon it’s support cast (Style Sheets, HTML). The best JavaScript code will be useless when combined with poorly structured HTML and badly written CSS. Likewise, the most logically structured XHTML will perform badly if combined with poorly written JavaScript. All three elements need to pull together to make a well functioning and rich user interface.
Inline JavaScript. All JavaScript should be contained within it’s own JavaScript file/files that should be included at the top of the user interface: Bad: <script type=”text/javascript”> /* Lines of JavaScript Code */ </script> Good: <script type=”text/javascript” href=”scripts.js”></script> Inline JavaScript Function Calls: Bad: <a href=”#” onclick=”somefunction(‘value1′)” title=”some”>Link</a> Good: <a href=”something.jsp” id=”object1″ title=”some”>Link</a> The good example has [...]