There are three basic to building of the web page, HTML/XHTML, CSS and JavaScript. HTML/XHTML as the core / main language to build a web page. CSS ( Cascading Style Sheet ), we used to adding style to our web pages and allowing we to lay them out in a way that is not only attractive but also adds visual impact. JavaScript is the third corner, allowing pages to do more than just be static documents.

In this discussion, we will discus about how to use JavaScript at our web pages and what advantages of we use it. The biggest advantages if we use it, our web pages feel more like an application running on client’s computers. So, our web pages more interactive and user friendly.

JavaScript is a client side scripting language for our web pages. So, we can include JavaScript commands directly in the our Web Pages / HTML document and the script will be executed when the our web page is viewed in a browser. Do we need special software to create JavaScript script ..? The first tools we’ll need to work with JavaScript is a text editor and web browser. A Text editor to create JavaScript script and stored in simple text files, usually as part of HTML documents. A web browser and a computer to run it on. We recommended to use Mozilla Firefox with Firebug plugin.

To begin creating script and include in the our web page, like most JavaScript programs, begins with HTML <script> tag in the our web pages / HTML documents. See following example how to add JavaScript in the our web pages.

<title>Sample create JavaScript</title>
<script language=”JavaScript” type=”text/javascript”</script>

Embedding JavaScript in the <head> tag and embedding JavaScript in the <body> tag are no different from another. It’s simply a matter of choice: some developers like to keep related code together, whereas others think that all scripts should be grouped together in the <head> so that we know exactly where to look instead of hunting through markup. If you’re going to embed your JavaScript, try to pick one convention and stick to it.

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Netvouz
  • DZone
  • ThisNext
  • MisterWong
  • Wists
  • Slashdot
  • Technorati
  • YahooMyWeb