R N REDDY .Net Community - ASP
Wednesday, 2016-12-07, 6:04 PM
Welcome Guest | RSS
Site menu
Tag Board
500
Our poll
Rate my site
Total of answers: 144
Statistics

Total online: 1
Guests: 1
Users: 0

$.Net Funda$

18-12-2010

Java Script:
    Java Script is a client side scripting language.
    Java script is light weight programming language.
    Using java script we can add the user interactivity to a web page.
    Java script code we can add to html documents.
    Using java script we can validate the user input at client side.
    Using java script we can identify the client web browser name & version.
    Using java script we can create cookies.

How to add Java Script code to html document ?

Java script is a case sensitive language.
To add java script code into html document we can use a tag called script.
Between the opening script tag & closing script tag we can write the java script program or java script code.
Within sccript tag we are using an attribute called type which is specifying the scripting language which we are using in html document.
We can write javascript code within head section as well as body section but the convenient place will be head section only.

    <html>
       <head>
        <script type = "text/javascript">

        </script>
       </head>
       <body>
        <script type = "text/javascript">

        </script>
       </body>
    </html>

Java script variable: Here to declare a variable we can use a keyword called variable. But variable keyword is not compulsory.

Syntax to declare a variable:
   
    var <variable name> = <value>
                    (or)
    <variable name> = <value>

If we declare a variable outside the function that variable we can access with in the html document.
Java script variable life will start at the time of declaration & the life will end when the html web page is closed

Pop up Boxes::

Alert Box:
To display a alert box we will use alert command like below

syntax:   alert("Message")
Eg:         alert("Virtual Memory is Low")


Confirm Box: To display a confirm box we will use confirm command like below

Syntax:   confirm("Message")
Eg:          confirm("Do you want to restart your computer")


Java Script Function: To define a java script function we will use "function" keyword.

Syntax to define a function:
    function <function name()>
      {
          Statement 1
         Statement 2   
      }

Html button control: Html will support various controls which can be called as html controls.
Every control will have its own functionality.
Html is supporting various input controls. Among them button is one of the html input control.
To create a html input control we can use a tag called input.

Type: Type is describing about the type of control which we are going to create.

Value: This attribute is representing the text which we want to display within the button control.

Event: Event is a reaction for some action, it will fire or execute when user will perform some action for every control we will have various events.

Onclick: It is an event of button control, this event will fire or execute when user will click on button control.

Eg to create button control:
    <input type = "button" value = "Hello" onclick= myfun()>

This statement will create a button control with in the web page.
When user will click on "Hello" button that concerned onclick event will fire or execute.
This will invoke myfun() java script function. This is called event firing.
Search

Time
 

 

Calendar
 
«  December 2016  »
SuMoTuWeThFrSa
    123
45678910
11121314151617
18192021222324
25262728293031

Twitter
 

Entries archive

Copyright R N Reddy © 2016Developed by Nagendra, Venkat, Vijaya and Yaswanth
Get free updates as SMS to your mobile. Just register by clicking here