Client-side scripting

Client-side scripting

Client-side scripting generally refers to the class of computer programs on the web that are executed client-side, by the user's web browser, instead of server-side (on the web server).[1] This type of computer programming is an important part of the Dynamic HTML (DHTML) concept, enabling web pages to be scripted; that is, to have different and changing content depending on user input, environmental conditions (such as the time of day), or other variables.


Method

Client-side scripts are often embedded within an HTML or XHTML document (hence known as an "embedded script"), but they may also be contained in a separate file, which is referenced by the document (or documents) that use it (hence known as an "external script"). Upon request, the necessary files are sent to the user's computer by the web server (or servers) on which they reside. The user's web browser executes the script, then displays the document, including any visible output from the script. Client-side scripts may also contain instructions for the browser to follow in response to certain user actions, (e.g., clicking a button). Often, these instructions can be followed without further communication with the server.

By viewing the file that contains the script, users may be able to see its source code. Many web authors learn how to write client-side scripts partly by examining the source code for other authors' scripts.

In contrast, server-side scripts, written in languages such as Perl, PHP, ASP.NET, Java, and server-side VBScript, are executed by the web server when the user requests a document. They produce output in a format understandable by web browsers (usually HTML), which is then sent to the user's computer. The user cannot see the script's source code (unless the author publishes the code separately), and may not even be aware that a script was executed. Documents produced by server-side scripts may, in turn, contain client-side scripts.

Client-side scripts have greater access to the information and functions available on the user's browser, whereas server-side scripts have greater access to the information and functions available on the server. Server-side scripts require that their language's interpreter be installed on the server, and produce the same output regardless of the client's browser, operating system, or other system details. Client-side scripts do not require additional software on the server (making them popular with authors who lack administrative access to their servers); however, they do require that the user's web browser understands the scripting language in which they are written. It is therefore impractical for an author to write scripts in a language that is not supported by popular web browsers.

Due to security restrictions, client-side scripts may not be allowed to access the user's computer beyond the web browser application. Techniques like ActiveX controls can be used to sidestep this restriction.

Client-side scripting is not inherently unsafe. Users are encouraged to always keep their web browsers up-to-date to avoid exposing their computer and data to vulnerabilities that are discovered.

The latest group of web browsers and web pages tend to employ a heavy amount of client-side scripting, accounting for an improved user interface in which the user does not experience the unfriendly "refreshing" of the web page, but instead sees perhaps an animated GIF file indicating that the request occurred and the page will be updated shortly. Ajax is an important addition to the JavaScript language, allowing web developers to communicate with the web server in the background without requiring a completely new version of the page to requested and rendered. This leads to a much improved user experience in general.

Unfortunately, even languages that are supported by a wide variety of browsers may not be implemented in precisely the same way across all browsers and operating systems. Authors are well-advised to review the behavior of their client-side scripts on a variety of platforms before they put them into use.

References

See also


Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать курсовую

Look at other dictionaries:

  • Client side Scripting — Le Client Side Scripting (script côté client) fait référence généralement à des programmes dans un contexte web qui s exécutent côté client (navigateur web, par opposition aux scripts Server Side s exécutant côté serveur Web. Principe Les scripts …   Wikipédia en Français

  • Client Side Scripting — Le Client Side Scripting (script côté client) fait en général référence à des programmes dans un contexte web qui s exécutent côté client (navigateur web, par opposition aux scripts Server Side s exécutant côté serveur Web. Principe Les scripts… …   Wikipédia en Français

  • Client-side — refers to operations that are performed by the client in a client–server relationship in a computer network. Typically, a client is a computer application, such as a web browser, that runs on a user s local computer or workstation and connects to …   Wikipedia

  • Client side — Dans le domaine informatique, le terme Client side ( côté client ) fait référence à la relation d un client dans une architecture Client serveur. Le client est une application comme un navigateur qui fonctionne localement sur l ordinateur et qui… …   Wikipédia en Français

  • Client-side JavaScript — (CSJS) is JavaScript that runs on the client side. While JavaScript was originally created to run this way, the term was coined because the language is no longer limited to just client side, since server side JavaScript (SSJS) is now available.… …   Wikipedia

  • Server-side scripting — is a web server technology in which a user s request is fulfilled by running a script directly on the web server to generate dynamic HTML pages. It is usually used to provide interactive web sites, that interface to databases or other data stores …   Wikipedia

  • Server Side Scripting — bezeichnet eine Technologie für Web Server bei der Benutzeranfragen erfüllt werden, indem ein Script (oder auch binäres Programm) auf dem Server ausgeführt wird um eine Dynamische Webseite zu erstellen. Im unterschied zu Client Side Scripting… …   Deutsch Wikipedia

  • Scripting language — Scripting redirects here. For other uses, see Script. A scripting language, script language, or extension language is a programming language that allows control of one or more applications. Scripts are distinct from the core code of the… …   Wikipedia

  • Client web — Navigateur Web Pour les articles homonymes, voir Navigateur. Un navigateur Web est un logiciel conçu pour consulter le World Wide Web. Techniquement, c est au minimum un client HTTP. Le terme navigateur web (ou navigateur Internet) est inspiré de …   Wikipédia en Français

  • Cross-site scripting — (XSS) is a type of computer security vulnerability typically found in Web applications that enables attackers to inject client side script into Web pages viewed by other users. A cross site scripting vulnerability may be used by attackers to… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”