Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 8. Elements > DOM Scripting with MooTools

8.3. DOM Scripting with MooTools

DOM scripting is the common term for using JavaScript to program a web page, and much of it involves manipulating elements on a page: selecting elements, creating new elements, moving elements around, changing their attributes and styles, and destroying them when necessary.

To script the DOM, you'll need to use the API provided by the DOM itself. Unfortunately, it's not a perfect API. In fact, a common saying in the JavaScript world is that when people say they hate JavaScript, what they're really saying is that they hate the DOM. I find this somewhat true, but unfortunate: the DOM API is one of the harder APIs to work with, but not because it was designed that way. The problem lies with the browsers that implement the API: somehow, browsers always find a way to add bugs and deviations from the specs. As such, the DOM API is inconsistent, and what works for one browser may not work for another.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint