Chapter 15: Fun with Client-Side Scripts PDF Print E-mail
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)
Please note: this file won't validate unless you comment out function theClock() because of its use of reserved characters (&, >, and so forth) in the JavaScript code.

Page 280, Figure 15-6, Listing 15-5: JavaScript and DOM clock (display view) (code view)
Please note: as above, the code on this sample page will not validate unless you comment out function theClock().

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)
Reload this page a few times to watch the cookie in action. Please note: you must comment out both scripts (in the <head> and <body> sections, respectively) for this file to validate.

Page 287: The (X)HTML <object> tag

 

.ZIP file of all code samples from this chapter (14 kb)

 



Share this page!
Reddit! Del.icio.us! JoomlaVote! Google! Live! Facebook! StumbleUpon! Yahoo! Free social bookmarking plugins and extensions for Joomla! websites!
Last Updated on Monday, 30 June 2008 11:43
 
Chapter Resources
Chapter 1
Chapter 2
Chapter 3
Chapter 4
Chapter 5
Chapter 6
Chapter 7
Chapter 8
Chapter 9
Chapter 10
Chapter 11
Chapter 12
Chapter 13
Chapter 14
Chapter 15
Chapter 16
Chapter 17
Chapter 18
Chapter 19
Chapter 20
Chapter 21
Chapter 22
Chapter 23
Feedback - send us a message
Featured Links:
Banner
Visit co-author
Ed Tittel's web site!
Visit co-author
Jeff Noble's web site!
Conquest Media
Web page layout and
hosting provided by
SheTech and Company. the power of the web. http://www.shetech.com