Tuesday, 2017-07-25, 10:13 PM
Welcome Guest | RSS
Site menu
Tag Board
500
Our poll
How is .Net classes by R.N.Reddy sir ?
Total of answers: 234
Statistics

Total online: 1
Guests: 1
Users: 0
Loction: Location property is a window object property.
It is representing current web browser displaying web page address.

Eg:
    <html>
       <head>
            <script type = "text/javascript">
            function currenturl()
           {
                alert(window.location)
           }
           function changeurl()
          {
               window.location = "http://www.gmail.com"
           }
           </script>
       </head>
       <body>
           <input type = "button" value = "current url" onclick= "curranturl()">
           <input type = "button" value = "Change url" onclick= "changeurl()">
       </body>
    </html>
Output:

document object: It is a java script predefined object, it is representing the html document.

This object can access the html document by using its properties.

Eg: To display title of the web page:

title: It is a property of document object.

Title property is representing the title of the html web page.

Using this property we can access the title tag content.

Synatx: document.title
    <html>
       <body>
          <script type = "text/javscript">
          alert("This web page page title is " +document.title)
          </script>
       </body>
    </html>
Output:

Eg: To display current web page url:

URL: It is a property of document object.

This property is representing the current html document or html web page url.

Syntax: document.URL
    <html>
       <head>
           <title> Microsoft Windows </title>
       </head>
       <body>
            <script type = "text/javascript">
            alert("This web page url " +document.URL)
            </script>
       </body>
    </html>
Output:

onmousedown: This event will fire when user will click mouse buttons.

event object: event is a java script pre-define object, it is holding complete information about the current raising event or firing event or executing event with some of properties.

event.button: Here button is a property of event this button property is representing the mouse buttons.

If user will click left mouse button this button property is representing with '1' value, if user will press right mouse button this button representing the '2' value.

Eg: For onmousedown event:
    <html>
       <head>
           <script type = "text/javscript">
           function whichbutton(event)
          {
               if (event.button == 1)
              alert(your are pressed left mouse button)
              else
              alert(your pressed right mouse button)
          }
          </script>
       </head>
       <body onmousedown= "whichbutton(event)">
       </body>
    </html>
Output:

Search

Time
 

 

Calendar
 
«  July 2017  »
SuMoTuWeThFrSa
      1
2345678
9101112131415
16171819202122
23242526272829
3031

Twitter
 

Entries archive

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