The Benefits of Client-side Scripting

Forms allow the user to communicate with the site by writing comments to the Webmaster or individualizing data output. A form is a graphical user interface (GUI) and presents entry fields, checkboxes, scrolling lists, pull-down menus, etcetera. In HTML, all form elements are placed in the “form” tag. The CGI program in the CGI directory is utilized in this scenario for the processing of the form’s input once the “Submit” button has been pressed. If a Web designer is unable to access the CGI directory, the user’s form will have to be sent to an e-mail address with the mailto action.

One example of a library’s use of forms would be an online request for the help of a reference librarian, which would likely consist of the user’s name, e-mail address, and question. Another potentially popular HTML form would be a book-buy suggestion box online, with which users could suggest specific book titles for the library to purchase. Another appropriate form for library Web pages would be a library feedback page for comments and complaints.

After the information has been submitted, the URL displays an altered combination of text. The original URL may look like “…/cgi/020398.htm”, while the altered URL might look like “…/cgi/020398.htm?in=hello+there&button=Send.” The latter URL is the encoded URL, and what is read by the CGI. The part of the URL before the question mark is the part that the server will use to determine which CGI script to run. The part of the URL after the question mark is the encoded data from the user. In the example above, the “in” element represents the text box used in the form and contains the value “hello+there”. The “button” element of the URL represents the “Submit” button in the form and contains the value “Send”.

While the simplest method of saving data from a form is to write it to a local file, it may not be the best. When data are sent to a server, a CGI program can connect to a database and save the information there, or it can send the data to another Web site. CGI programming is a server-side technology and many server-side programming languages exist that can be made to work as a CGI program.

A server-side language is one that runs from the server, which keeps the client from seeing the code, and does not require that the browser support the language being utilized from the server. A Web programming language that resides on the client’s side is one that downloads to the user and runs from the user’s computer. The benefit of client-side Web programming is that the code can execute on the downloaded page rather than having the data sent to the server to be executed, which takes more time. Client-side scripting compared to server-side scripting can reduce server load by 80%. A negative aspect of this arrangement is the potential for old browsers to not work with the scripting languages. Client-side scripting has remained primarily useful only for limited, controlled intranets where webmasters can be sure that all users are using the same browser software to view web pages.

Please visit www.sunnymicro.com, www.wildsunset.com, and www.yukonmax.com


TOP