Home » ASP.NET Basics » 01 - Introduction to ASP.NET 2.0
1

Client-Side Scripting

Explains what client-side scripting is

Client-side scripts run on the user's browser. The developer writes the HTML page and the code for creating the interactive elements on the page (like displaying message boxes or update the date and time). This code is written using a scripting language like JavaScript. When a user requests for the page, the web server sends the HTML page along with the code to the user's browser. The browser first processes the code and then displays the HTML page with all the interactive elements. The point to remember about client-side scripting is that the web server just sends the web page with the scripting code to the browser. It is up to the browser to process the code and display the page correctly.

Client-side scripting has some disadvantages. Since the browser runs the code, the user can see it by viewing the source code of the page. Client-side scripts cannot access the files and database stored on the web server. Another limitation is cross-browser compatibility. Since not all browsers process scripts similarly, a script that runs well on one browser may not run correctly on another browser. On the positive side, a client-side script runs faster than a server-side script.