| Chapter 15: Fun with Client-Side Scripts |
|
|
|
| Sections - Part IV: Integrating Scripts with (X)HTML | |
|
If you're the outdoor type, you can get an adrenaline rush by climbing a mountain, mountain biking, or perhaps inventing a new sport, such as parafishing or sewer snorkeling. If you are reading this book, chances are you're sitting in front of a computer trying to create a Web site. If so, we have another idea for the ultimate Web adrenaline rush: Dynamic HTML! Dynamic HTML, also known as DHTML, is techie talk for a useful and powerful set of technologies. It's the combination of HTML, Cascading Style Sheets (CSS), the Document Object Model (the DOM0, and JavaScript. If you use these four technologies together, you're creating DHTML. DHTML is like a printed document in which the DOM acts as the nouns, JavaScript as the verbs, CSS as the adjectives, and HTML as the paper itself. The individual parts are useful, but it's in combination that they become truly powerful. If you can put them all together, you can speak DHTML. In this chapter, we explore how to use DHTML and its component technologies to bring active content to your Web pages. Specifically, we explore how to create rollovers, add dynamic content to your page, display pop-up windows, and tap in to the power of cookies. Page 272, Figure 15-1: JavaScript image rollover (display view) (code view)Hint: don't click the Home button, just let your mouse cursor hover over it to see it change color, then remove the cursor elsewhere and it changes back. Page 273, Listing 15-1: JavaScript image rollover (display view) (code view) Hint: as in the previous example, don't click the Home button, just hover over the button, then move away as before to change back. Page 276, Figures 15-2, 15-3, 15-4; Page 277, Listing 15-3: Text rollover (display view) (code view) Page 278, Figure 15-5, Listing 15-4: Dynamic content (display view) (code view) Page 280, Figure 15-6, Listing 15-5: JavaScript and DOM clock (display view) (code view) Page 282, Figure 15-7, Listing 15-6: Opening a new browser window (display view) (code view) Page 285, Figure 15-8, 15-9, Listing 15-7: Cookies (display view) (code view) Page 287: The (X)HTML <object> tag
.ZIP file of all code samples from this chapter (14 kb)
|
|
| Last Updated on Monday, 30 June 2008 11:43 |