BLOG: JavaScript Links or onClick Links?


JavaScript links, or links with javascript in the href attribute, cause problems for visitors who either turn off or don't have JavaScript support in their browsers. Not to be callous, but, in almost all cases, this percentage of your audience is small.

As a compromise, you can always use self-referential links that respond to onClick events. These links are easier for non-JavaScript browsers to handle, but then you have the problem of the browser jumping back to the top of the page. This inconveniences a larger cross-section of your audience than it helps.

If you really want to court the HTML purists, don't use JavaScript on your site, period. However, if you want or need the extra functionality, JavaScript links work better than onClick links for the majority of your visitors.



Web Design Garage
Web Design Garage
ISBN: 0131481991
EAN: 2147483647
Year: 2006
Pages: 202
Authors: Marc Campbell

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net