Need of Client Side Scripting
There are various reasons for client-side scripting, but it can pretty much all be stated as “browsers and client machines are faster and bigger and more powerful than they used to be. Use that capability – only do things on the server that require server-side resources to do, or that cannot be done more quickly and easily on the client”. This has a number of benefits:
- It allows the server to serve more clients with the same system resources, since some of the stuff it used to do (laying out the HTML for each page after a request, for example) is now being done on the client
- Other than sending the original resources (images, CSS, HTML, JS files) to get the page up and running, the only thing that needs to be sent later is the data that changes as the user uses the site/application. This cuts down on network traffic, which again allows more clients to be served.
- Many things that clients do don’t actually require a round-trip to the server. For example, showing a drop-down menu can be done with client-side scripting easily, assuming you have some idea of what menu items need to be displayed and how they are organized (which itself is really data – it doesn’t have to be hard-coded as HTML). Given this menu data, there’s no real need to ask the server to do anything at all. Another example is client-side verification of user input (e.g., when entering an email address, the client script can verify that the format of the address is valid. It can then leave it to the server to verify that the actual address itself exists, if necessary).
- It’s *much* faster to do interactive things only on the client, instead of requiring a round-trip to the server (animations, button-press visual changes), timed events, etc.
Server Side Scripting Language
Server-side scripting is often used to provide a customized interface for the user. These scripts may assemble client characteristics for use in customizing the response based on those characteristics, the user’s requirements, access rights, etc. Server-side scripting also enables the website owner to hide the source code that generates the interface, whereas, with client-side scripting, the user has access to all the code received by the client. A downside to the use of server-side scripting is that the client needs to make further requests over the network to the server in order to show new information to the user via the web browser. These requests can slow down the experience for the user, place more load on the server, and prevent the use of the application when the user is disconnected from the server.
When the server serves data in a commonly used manner, for example, according to the HTTP or FTP protocols, users may have their choice of a number of client programs (most modern web browsers can request and receive data using both of those protocols). In the case of more specialized applications, programmers may write their own server, client, and communications protocol, that can only be used with one another.
Programs that run on a user’s local computer without ever sending or receiving data over a network are not considered clients, and so the operations of such programs would not be considered client-side operations.
- Client-side validation
- Dynamic drop-down menus
- Displaying date and time
- Validate user input in an HTML form before sending the data to a server.
- Build forms that respond to user input without accessing a server.
- Change the appearance of HTML documents and dynamically write HTML into separate Windows
- Open and close new windows or frames.
- Manipulate HTML “layers including hiding, moving, and allowing the user to drag then around a browser window.
- Build small but complete client side programs.
- Displaying popup windows and dialog boxes Bike alert dialog box, confirm dialog box and prompt dialog box)
- Displaying clocks etc
- Giving the user more control over the browser.
- Handles dates and time efficiently
- Detects the user’s browser and OS.
- It is light weighted.
- It cannot be used for networking applications because there is no such support It doesn’t have any or multiprocessor capabilities.
- Cannot access web pages hosted on a different domain.
- Cannot access databases.
- Depends a lot on the browser.
- Inability to use local devices.
- Not Search Engine Friendly.