Client-side scripting: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 5:
Web authors write [[client-side]] scripts in languages such as [[JavaScript]] ([[Client-side JavaScript]]) and [[VBScript]].
 
==Method==
Client-side scripts are often embedded within an [[HTML]] document (hence known as an "embedded script"), but they may also be contained in a separate [[Computer file|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]] [[Execution (computers)|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 if the user interacts with the document in a certain way, e.g., clicks a certain button. These instructions can be followed without further communication with the server, though they may require such communication.
 
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.