Tuesday, 21 August 2012

javascript

Run your first program in JavaScript !!



This post will describe you about running your first program in JavaScript.
Starting with this, a user must have some introductory knowledge:
  • It is a scripted weekly-typed, dynamic language.
  • Scripting language is a light-weight programming language.
  • Appeared in the year 1995 and was designed by Brendan Eich.
  • It is an implementation of ECMAScript language standard.
  • File-extension is .js
  • It is used in web pages, desktop apps, internet servers etc.

Write the following code in any text file like notepad, notepad++ etc,
 then save this file as .html or .htm extension: amitdiwanJS.html

_____________________________________________________________________
<html>
     <head><title>amtdw.blogspot.com</title></head>
<body>   

<!-- <script> tag is used to insert JavaScript into html document. -->
<script>
document.write("<p><u>first javascript program for beginners</u></p>");
document.write("<b>My Blog:amtdw.blogspot.com</b></p>") ;
</script>

</body>
</html>



____________________________________________________________________

The above can be explained as:
  •  for HTML tags refer my blog post for html i.e. 
  • <script> : this tag is used to insert JavaScript into html document.
  • document.write: this prints the text to the page.
  •  !--      --> : these are used for comments




Now. open the above page(amitdiwanJS.html) under any Web Browser:


Output :(this will shown on the browser as web page)





This way you can run your program in JavaScript by inserting <script> tag in HTML
Simple... :)



__________________________________________________________________________
Please comment and forward to others if you like this.
Other posts with video tutorial yet to come.....
"I am sure that blogs really help people around the world.
Let us follow this simple thinking of sharing knowledge . . ."








No comments:

Post a Comment