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 6. Understanding JavaScript

Chapter 6. Understanding JavaScript

Many Web authors come to XML from HTML, and they don't have much programming experience beyond writing HTML. Programming experience is not a requirement in HTML, of course, because the HTML is interpreted and displayed by a Web browser. XML is different, however, because it's specifically intended to encapsulate data. And although a browser can make that data accessible to you, it's up to you to go get it—and that means using some programming skills. In this chapter, we'll develop the skills that we need to work with XML in today's browsers. (It's not necessary to write any programming code to simply display XML documents in a browser, of course—you can display it directly, or you can create a style sheet. We'll take a look at that in detail in a few chapters.)

These days, the browser that lets you interact with XML documents in the most powerful and general way is Microsoft's Internet Explorer. Whatever you think of Microsoft, there's no denying that it's making a serious attempt to support XML, and you can write code in Internet Explorer to work with XML documents in either VBScript (Microsoft's proprietary scripting language based on its Visual Basic language) or JavaScript. Other browsers will follow suit—for example, the prototype version of Netscape Navigator 6 already offers some XML support; although this will allow you to access XML documents from code in the future, Netscape hasn't said much publicly on the point yet. To support the largest number of browsers, I'll use JavaScript to access XML in browsers in this book (and we'll also use Java itself later in the book), and this chapter will provide the foundation for that work. If you're already a JavaScript pro, feel free to skip to Chapter 7, "Handling XML Documents with JavaScript"—you still might want to scan through this chapter first, though.


  

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