O'Reilly logo

Web Technology: Theory and Practice by M. Srinivasan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

4.4 AN EXAMPLE

It is said that a language like JavaScript is best learnt by examples but first things first—A JavaScript code is written as a text file and embedded as part of HTML. We have seen earlier that HTML supports extensibility intrinsically and we show an example of how it done.

Thus the steps to run JavaScript (on the client side) are as follows.

  1. Write the program—Use any text editor, but given that a lot of IDEs support a web programming eco system, it is always better to use them. Use of an HTML editor will also help.
  2. Embed the script within an HTML (XHTML) code
  3. Invoke the HTML through a browser

Note that the above steps are not the only way to invoke a CS JavaScript. In fact, the above is just about OK for small snippets of the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required