learn Javascript tutorial


      What is java script 

   • it is light weight programming language
   • java script can be inserted into an HTML page.
    • java script is an open scripting languages that any one can use it without purchasing the licence 
    • java script is supported by major brown sers like netspcape , internet explorer.

    How does it work 
 • when java script is inserted into an HTML document , the interpret the java script .
  • the java script can be executed immediately or when some events occurs.

     What a java script can do ?
   •  java script gives html designers a programming tool. 
    • it can enhance the dynamic and interactive features of your page by allowing you to perform calculation 
• java script can 
       >Check forms
        >Write interactive games
         > Add special effects 
          > Customize graphics selection 
• java script can put a dynamic text into an HTML page.
Ex: 
       Document write ("<h1>"+name +"<h1>");
        Can write a variable text into the display of HTML page just like a static HTML text :
       <H1>hello</h1> does.
• java script can read and write html element 
• java script can react to events. A java script can be set to execute when something happens like when a page has finished loading or when a user clicks on an HTML elements 
• java script can be used to validate data in a form before it is submitted to a server.

<Script> tag 
• the primary method of including java script within html is by using the <script> tag to specify scripting language name. We have to use "language attribute" with <script>tag. 
   Ex.
         <Script language ="java script"> indicates java script 
          <Script language="VBS"> indicates vb script 

Sample code:
        <HTML>
       <Head>
                <Title > java script test program </title>
                 </Head>
                <Body>
                           <Script language="java script">
                 Document write ("hello");
        </Script>
      </Body>
     </HTML>

Sample 2: 
       <HTML>
      <Head>
          <Title> java script test program</title>
       </Head>
       <Body>
              <Script language="javascript">
           <B>
            Document write ("hello");
          <B>
</Script>
 </Body>
</HTML>

Sample 3: 
   <HTML>
    <Head> 
     <Title> javascript test program</title>
     </Head>
<Body>
         Fist time:
        <Script language="javascript">
                Alert ("1"time");
       </Script> 
Second time:
     <Script language =" javascript ">
            Alert ("2"time");
   </Script>

Third time:
<Script language="javascript">
  Alert "3"time");
</Script>
</Body>
</HTML>

Javascript 
          
          Javascript is an easy-to-use programming language that can be embedded in the header of you web page it can enhance the dynamic and interactive features  of your page by allowing you to perform calculation check from write interactive games add special effects customer graphic selection create security password and more.

Advantages of javascript :
     
• less server interaction :you validate user input before sending the page off to the server .this saves traffic which means iess load on you server .
• immediate feedback ot the visitors they don't have to wait for a page reload to see if they have forgotten to enter something.
•lncresed interactive :you can create interfaces that react when user hover over them with a mouse or activates them via the keyboard .
• richar interface: you can use javascript to include such items as drag and drop components and sliders to give a rich interface to you site visitors

      Limitations with javascript :
      We cannot treat javascript as a full fledged programming language. It lacks the following important feature .
•.  Client-side javascript does not allow the reading or writing of files . This has been kept for security reasons.
•. Javascript cannot be used for networking application because thaere is no such support available 
• javascript doesn't have any multithreaded or multi - process capabilities .

Post a Comment

0 Comments