Web site directory - Scripting in the Browser CHAPTER 8 Chapters 6
Monday, October 22nd, 2007Scripting in the Browser CHAPTER 8 Chapters 6 and 7 showed how to work with client-side XML. I discussed support for XML in the major web browsers and examined how to transform data using Extensible Stylesheet Language Transformations (XSLT). I briefly touched on some uses of JavaScript to work with the Document Object Model (DOM). JavaScript provides great flexibility for working with client-side XML. In this chapter, I ll show you how to use JavaScript to work with XML content. The chapter starts by looking at the World Wide Web Consortium (W3C) XML DOM and then shows how to use it with JavaScript to manipulate XML documents. I ll examine some of the key DOM interfaces before looking at the differences between Internet Explorer (IE) and Mozilla. You ll see one approach to managing these differences using a wrapper library, and you ll finish the chapter by applying what you ve learned. During the chapter, you ll learn how to work with XML data dynamically and request content without server-side processing. I tested the examples in Firefox 1.5 and IE 6.0. You can download the code samples from the Source Code area of the Apress web site (http://www.apress.com). Let s start by learning more about the XML DOM. The W3C XML DOM I introduced the W3C DOM earlier in this book. The DOM represents structured documents as an object-oriented model. It creates a tree-like structure of objects that developers can use to target and manipulate parts of the document. Vendors can implement the DOM interfaces in a language or platform of their choice. This chapter uses JavaScript to manipulate the DOM in IE and Firefox. Both of these browsers provide support for the W3C DOM, but there are some differences between the two.
If you are looking for cheap and quality webhost to host and run your website check Jboss Web Hosting services.