Chapter 2. Back to the basics

 

This chapter covers

  • Learning how to bootstrap your JavaScript code properly
  • Managing DOM elements with Ext.Element
  • Loading HTML fragments via Ajax
  • Exercising a simple highlight effect on an HTML element
  • Implementing Templates and XTemplates

When working on applications, I often think metaphorically, which helps me develop parallels for concepts in my mind. I like to think of the timing of an application’s launch as similar to that of the space shuttle’s launch, where timing can mean the difference between a successful launch and inevitable frustration. Knowing when to initialize your JavaScript is one of the most critical things when dealing with anything that manipulates the DOM. In this chapter you’ll learn how to launch your JavaScript using Ext to ensure your application code initializes at the right time on each browser. We can then begin our discussion on using Ext.Element to manipulate the DOM.

As you know, DOM manipulation is one of the tasks that web developers are required to code for most of the time. Whether it’s addition or removal of elements, I’m sure you’ve felt the pain of performing these tasks with the out-of-the-box JavaScript methods. After all, DHTML has been at the center of dynamic web pages for ages now.

2.1. Starting off the right way

2.2. The Ext.Element class

2.3. Using Templates and XTemplates

2.4. Summary

sitemap