|
![]() Web Design Handbook « Scripts
Scripts can be designed to run on the server and deliever content via the script to the browser or scripts can run in the browser. The most common browser based scripts are javascripts; they server the purpose of making the page dynamic, doing page formating for the specific to the browser, modifing or preprocessing of form data, etc.
Scripts that run on the server deliever specific data based on query or any number of reasons. Perl, active server pages, and PHP are examples of server based scripts. Data can also be included on a page using SSI (Server Side Includes) or programs themselves can generate content.
A program written in C++ to generate content would run faster on the server than a script but the program would need to be compiled to run on the operating system used on the host, and this can vary. The advantage of a script is it is universally supported by all hosts regardless of the underling operating system being used.
The browser does not know or care how data is put togeather at the server. It determine what kind of data it is getting by what is called a MIMI type and then renders the information accordingly. MIMI type information is part of the header which is delieved by the server before the actual information and it is supplied in plain old easy to read text.
A "hello world" script only needs to provide the header information that identifies what it is followed by the content here is an example:
|