javaScript Tutorials

what is javascript ?

javascript(js) is an interpreted computer programming language.it was originally implemented as part of web browsers so that client-side scripts could interact with the user, control the browser, communicate asynchronously, and alter the document content that was displayed.

javascript is a lightweight, interpreted programming language.

javascript is a prototype based object- oriented programming language.


advantages of javaScript

  • javascript is executed on the client side
  • javascript is a relatively easy language
  • javascript is relatively fast to the end user
  • extended functionality to web pages

what exactly does JavaScript do ?

  • javascript allows programming to be performed without server interaction
  • javascript can validate data before sending out a request
  • javascript can adjust an html document for special effects
  • javascript can respond to events, such as button click, mouse over
  • dynamic document generation
  • use to create navigation system
  • basic mathematical calculations
  • manipulation of structured documents
  • it can create cookies! cookies can be used to store and retrieve information from the user's computer

notejavascript and Java are two completely different languages, in both concept and design. Java (invented by Sun) is a more complex programming language in the same category as C.

ECMA-262 is the official name of the JavaScript standard

JavaScript was created by Brendan Eich.It appeared in Netscape (a no longer existing browser) in 1995, and has been adopted by ECMA (a standard association) since 1997.

look daynamic html document

<!doctype html>
   
 <html>
     
     <head> 
        
           <style  type = "text/css"  >
           
           p{font-size:14px;color:#3a4b9c;}
           
           div{width:500px;height:600px;}
           
          </style>
          
   <script>
   
         var  a = 10;  document.write("the a value ="+a);
         
         var  b = 20   document.write("the b value ="+b);
         
 </script>
 
 </head>
 
 <body>
 
  <div>
  
  <p> this is the good html document <p>                        

</div>

  <script>
  
document.write("<h1>"this is the script code inside the body section </h1>");
     
</script>     

</body>

</html>

the javascript language is case sensitive.it support all basic fundamentals of a programming language.such as

  • objects - can hold any type of data and are the primery mechanism by which useful tasks are carried out. the browser provides a large number of objects for you to use. - for example window object use modify the content of the web page with the Document object.
  • functions - are used to encapsulate code that performs a specific task.javascript functions are declared with the function keyword.
  • regular expressions - a regular expression as defined by the regexp constructor is used to carry out pattern matching.
  • arrays - is an ordered set of values grouped together under a single identifier.
  • flow control statements - javascript supports conditionals like if/else and switch/case statements that permit the selective execution of pieces of code
  • loops - javascript support while, do/while, for, for/in loops.
  • basic data types - javascript support all basic data types integer, float, Double, strings, booleans,null,undefined.
  • weak typing - most high-level languages, including c and java are strongly typed.that is, a variable must be declared before it is used, and its type must be included in its declaration.in weakly typed language every variable and literal has a type,but data types are not explicitly declared.