|
Common uses of JavaScript in web database applications include:
-
Validation of
<form>
data, the main topic of this section. -
Simple interaction with
<form>
data; e.g., JavaScript is often used to calculate values and display these in a data-entry widget. -
Enhancing user interactions by adding dynamic elements to a web page. Common features include pull-down menus, mouseover changes to the presentation (rollovers ), and dialog boxes.
-
Customizing the browser (i.e. closing browser's window, back to previous page, break out of frames, add to favorites/bookmark etc.) and using information from the browser to enhance presentation.
Displaying date, calendar, referring page and client's IP address, copy selected text, focus an html element or form element onload and many more.
Most of these techniques are oriented around events. An event is an action that occurs-such as a mouse passing over an object or a user clicking on a button-and that can be trapped through JavaScript code.
JavaScript is very easy to implement, all we need to do is put your code in the HTML document and tell the browser that it is JavaScript by specifying javascript tag. JavaScript allows us to create highly responsive interfaces that improve the user experience and provide dynamic functionality, without having to wait for the server to react and show another page. JavaScript also help fix browser problems or patch holes in browser support, for example fixing CSS layout issues in certain browsers.