* New post Constructor Destructor and Inheritance& Array , Virtual base class in c++ language

Wednesday, 8 May 2013

0 Javascript Document Object Model

Javascript Document Object Model


Introduction
An HTML page is painted in a browser. The browser assembles all the element (objects) contained in the html page , downloaded from the web server , in its memory. Once done the browser then paints these objects in the browser windows. Once the html page is painted in the browser window , the browser can no longer recognize individual html elements (objects).
To create an interactive web page it is imperative that the browser continues to recognize individual html objects even after they are painted in the browser window . This allow the browser to access the properties of these objects using the built-in methods of the onject. Once the properties of an objects are accessible then the functionality of the objects can be controlled.
Javascript enabled browser are capable of recobnizing individual object in an html page , after the page has been painted in the browser , because the javascript enabled browser recognizes and uses the document obkect model.
Using the DOM (document object model ) javascript enabled browser identify the collection of web page objects that have to be dealt with while rendering as html based , web page in the browser window.
The html object , that belong to the dom , have a descending relationship with each other.
Javascript assisted Style Sheets Dom (JsssDom) 
JSSS use javascript syntax to control a document  presentation style . When a JSSS is embedded  is an html page within the <head>.............</head> tags , then the javascript DOM picks up a whole new set of objects , that add to the standard DOM objects already recognized by javascript . The additional objects brought into the DOM by JSSS .
By extending the dom recognized by javascript by embedding JSSS in a web page , developers of web pages can access every element of a web page whether  this element  appears on the page when it is rendered in a client browser or not. 
By accessing appropriate properties of the navigator object , the topmost object in the DOM , javascript can recognize the browser type (i.e netscape navigator , internet explorer , opera and so on.) and susequently dispatch all html pages to the browser from the web server , with a style based on this knowledge .
Since Javascript understands the DOM and can extend the DOM with the use of JSSS in a web page javascript understands objects.
All objects are as follows:
  • Properties = It can determine the functionality of the objects.
  • Methods= It can allow to access to these properties.
  • Events = It can allow javascript  code snippets to be connected to the object by being mapped to appropriate javascript event handlers.
Note :- Javascript is an object - based programming language it is not fully object oriented . It does not fully support basic object oriented programming capabilities such as classification , inheritance , ancaptulation , and information hiding.
Browser Objects
When any javascript enabled browser loads a web page , the browser automativally creates a number of javascript objects that map to the DOM  (or JSSS DOM) . It is the  DOM , that provides javascript access to the html objects that are contained in the web page. The javascript code snippets imbedded as part of the web page itself (i.e embedded within the <script> </script> tags of yfc.html) makes use of these objects to interact with the HTML objects in the web page.
  

0 comments:

Post a Comment

 

PROGRAMMINGqueen Copyright © 2011 - |- Template created by O Pregador - |- Powered by Blogger Templates

Blogger Widgets