Thursday, September 27, 2012

What is DOM Scripting?

DOM Scripting is an important asset to any JavaScript expert, but what is DOM Scripting and why are we learning DOM Scripting when we are here to learn freaking JavaScript? Ok first, DOM Scripting IS JavaScript you see, its simply a better way of gathering elements, attributes and values to do some really cool stuff. DOM is also W3C recommended for valid JavaScript across all major browsers.

When Do I use DOM Scripting?
If and when you are creating a script and it needs to gather, place or manipulate values or even elements them self’s you are going to be using DOM Scripting FACT.
DOM scripting has taken on its own form aside from JavaScript because it’s a collation of how to do things right across all browser the first time. Many people make the mistake of trying to learn everything about JavaScript first but are left wondering how to gather information out of elements. This is why I took our lesson today to this area proceeding our first tutorial. So again when do you use DOM Scripting? When ever you need to manipulate or receive something from an element.

How Do I use DOM Scripting?
  • The name says it all my friend.
  • Document (refers to the document the script is being performed on.)
  • Object (refers to the object or element our script is trying to get at.)
  • Modeling (modeling is what we do with the object or get out of the object once we have retrieved it.)
  • Don’t feel over whelmed if the above did not make sense right now, simple think about it like this.
  • When ever you visit a web page, each page is a document correct?
  • Each document is made up of different elements that makes up the web site correct?
  • If we had some JavaScript to run on one of these pages, most of the JavaScript would be dealing with these elements or values from elements right?
  • So the whole goal here is to be able to identify a document, grab any of its elements, and model the element or information from the element however we want with our JavaScript.

No comments:

Post a Comment