What is Javascript good for?
Because any general web user may have javascript in their browser disabled any use of javascript on a web page is best limited to enhancing the functionality, user friendliness and overall experience on your web pages. Nothing on your page should absolutely depend on javascript unless it’s a non-essential part of the page. Javascript can also be used to make a page less friendly but there’s no point in doing that. Useful things: Forms Validation, because Javascript can be disabled you must always perform validation on the server side but any validation of user input you can also perform interactively with the user before a form is submitted can save the user a round trip to the server and can save your server a hit where no actual transaction occurs. Interactive Forms, In the case of something like an online store it’s always nice to update order totals and (when possible) shipping costs and other incidental costs (handling fees, taxes…) as the user updates the quantities or selects/