Syntax and Basics Of JavaScript .. - Ashutosh

Hot

Post Top Ad

Monday, September 25, 2017

Syntax and Basics Of JavaScript ..

Hello, Everyone Myself ~ Ashutosh . And today you learn about Syntax and basics of JavaScript.. Lets Start....




The Syntax of JavaScript will be simple to anyone who has ever programmed in an object oriented language. The primary object is the window , which is at the top of the hierarchy. under that are the documents, history, and navigator objects. In turn, The document objects contains anchors, applets , forms, images , each of which is an array of objects. So, a refernce to the first image on a page would be to self.document.image[0] , although it is preferable to use names instead of numbers for clarity.

JavaScript is not a stand-alone language, but rather a scripting add-on to HTML .JavaScript is added to HTML commands by use the <SCRIPT> tag. Anything within this tag is ( or should be) ignored by browsers that do not support JavaScript . Javascript is the most popular scripting language in use due to its cross- platform and cross- browser support , although VBScript is sometimes used on intranets when the scripter knows that everyone accessing the page is on Windows . Javascipt will attempt to execute the command within the <SCRIPT> tag if there is no LANGUAGE attributes , or if the LANGUAGE attributes is set to JavaScript ; in addition, the LANGUAGE attributes also can be used to distinguish between various versions of JavaScript.


The JavaScript in Listing 1 consists of a single line : document .write ("Hello,Word!"). This writes the typical "Hello ,World" message , using the document , write () method. This method dynamically generates text within HTML files , in lieu of hard -coded HTML.


Hello.html



<HTML>
<HEAD>
<TITLE> Barley a script at all </TITLE>
</HEAD>
<BODY BG COLOR = WHITE>
<H1>
<SCRIPT LANGUAGE="JAVASCRIPT">
document.write("Hello,World")
</SCRIPT>
</H1>
</BODY>
</HTML>

  
                                   *****

Written With Heart 💙

Thanks 

Created By Ashutosh

Subscribe- ashutosh000.blogspot.com