Sunday, November 28, 2010

Exercise 1:







exercise 1.Write the following web page:

<html>
<head> <title>Javascript</title> </head>
<body>
<p>
The following text is written to the page by Javascript.
</p>
<script type="text/javascript">
document.write("<center> <h1> Hi! </h1></center>")
</script>
</body>
</html>

The above script demonstrates the basic object.method (object-dot-method) paradigm.

  • The ‘document’ object (the web page) has a 'write' method associated with it.
  • The 'write' method acts on an ‘argument’ (a techie word for the target of a method).
  • The ‘argument’ is placed in () brackets after the method.



  • No comments: