What is the purpose of using JavaScript

What is the purpose of using JavaScript - to every odd row....

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
What is the purpose of using JavaScript® on a website? Javascript allows for manipulating design elements on webpages such as links and web applications (Gmail heavily relies on Javascript, for example). You need javascript if you want to have the full functionality of most websites. Basically, javascript improves user performance by offering a dynamic appearance. What is a specific example of a JavaScript® application that will be beneficial on the site you are creating? Use an example other than form validation. One 'effect' I have started to use recently, which is great for javascript, is simply colouring alternate rows in a table a different colour. You can step through a <table> element and add a class called 'odd' (or something)
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: to every odd row. That class is then defined in your CSS - so presentation is still in the CSS. It then doesn't matter whether you add or remove rows in your table, it will be ok. This function can be very generic so it only ever has to be written once and it will work on any table. Something which is best kept out of server-side scripting (PHP. ..); since you would have to manually incorporate it into every table you generated. And trying to manually edit your HTML each time is a nightmare. What is the step-by-step process that would be followed to add the JavaScript described in your example to a website?...
View Full Document

This note was uploaded on 02/22/2012 for the course COMPUTER WEB240 taught by Professor Kenii during the Spring '12 term at University of Phoenix.

Ask a homework question - tutors are online