To run on an user’s browser in order to perform some functionality client-side programming involves developing scripts.
However there are some fundamental uses of client-side programming:
- It enhance browser-based website usability.
- Run checks on form values to make sure they are valid (e.g., check a password to make sure it is strong enough, a name is valid etc.)
- It enhance website design
- It also permit third-party plugins to add functionality and improve user experience
Client-side scripts are also known as embedded scripts as often they are embedded within an HTML or XHTML document. We can also contain these scripts in a separate file and to consume it we will have to give its reference in the document which is using it.
The essential files are sent to the user’s computer by the web server on which they reside. After that the script is executed by the user’s web browser results into a displayed document.
Users can also view the source code by viewing the script that contains the script.