Sunday, March 28, 2010
Scripts
HTML is a static method of deploying content—the content is sent out to a client
browser where it is rendered and read, but it typically doesn’t change once it is
delivered. However, there is a need in HTML documents for such things as
decision-making ability, form validation, and, in the case of Dynamic HTML (DHTML),
dynamic object attribute changes. In those cases (and more), client-side scripting
can be used.
Client-side scripting languages, such as JavaScript, have their code passed to the
client browser inside the HTML document. It is the client's responsibility to interpret
the code and act accordingly. Most client-side scripts are contained in the <head>
section of the HTML document, within <script> tags, similar to the following
example:
<html>
<head>
<script language-"JavaScript">
function MiscWindow(w,h,url){
opts -"width-"+w+",height-"+h;
opts -opts+",scrollbars-no,resizable-yes";
fin-window.open(url," ",opts);
}
</script>
</head>...
In most cases, the document needs to include events to run the script(s). These
events can be embedded in elements , tied to links, called via form elements,
or run upon the document being loaded or unloaded


Currently have 0 comments: