Sams Teach Yourself HTML 4 in 24 Hours
- Table of Contents
- Copyright
- About the Author
- Acknowledgments
- Tell Us What You Think!
- Put Your HTML Page Online Today
- I. Your First Web Page
- Hour 1. Understanding HTML and XML
- Hour 2. Create a Web Page Right Now
- Hour 3. Linking to Other Web Pages
- Hour 4. Publishing Your HTML Pages
- II. Web Page Text
- Hour 5. Text Alignment and Lists
- Hour 6. Text Formatting and Font Control
- Hour 7. Email Links and Links Within a Page
- Hour 8. Creating HTML Forms
- III. Web Page Graphics
- Hour 9. Creating Your Own Web Page Graphics
- Hour 10. Putting Graphics on a Web Page
- Hour 11. Custom Backgrounds and Colors
- Hour 12. Creating Animated Graphics
- IV. Web Page Design
- Hour 13. Page Design and Layout
- Hour 14. Graphical Links and Imagemaps
- Hour 15. Advanced Layout with Tables
- Hour 16. Using Style Sheets
- V. Dynamic Web Pages
- Hour 17. Embedding Multimedia in Web Pages
- Hour 18. Interactive Pages with Applets and ActiveX
- Hour 19. Web Page Scripting for Non-Programmers
- Hour 20. Setting Pages in Motion with Dynamic HTML
- VI. Building a Web Site
- Hour 21. Multipage Layout with Frames
- Hour 22. Organizing and Managing a Web Site
- Hour 23. Helping People Find Your Web Pages
- Hour 24. Planning for the Future of HTML
- VII. Appendixes
- A. Readers' Most Frequently Asked Questions
- B. HTML Learning Resources on the Internet
- C. Complete HTML 4 Quick Reference
- D. HTML Character Entities
ActiveX Controls
For quite some time, Microsoft Windows has included a feature called object linking and embedding (OLE), which allows all or part of one program to be embedded in a document that you are working on with another program. For example, you can use OLE to put a spreadsheet in a word processing document.
When the Internet explosion rocked the world in the mid-'90s, Microsoft adapted its OLE technology to work with HTML pages online and renamed it ActiveX. Everybody likes to invent his or her own jargon, so ActiveX programs are called controls rather than applets.
Although ActiveX is touted as Java's main competitor, it actually isn't a specific programming language. It's a standard for making programs written in any language conform to the same protocols, so that neither you, the Web page author, nor the people who view your pages need to be aware of the language in which the control was written. It just works, whether the programmer used Visual Basic, VBScript (a simplified version of Visual Basic), C++, or even Java.
It's not surprising that support for the Microsoft ActiveX protocol is built into Microsoft Internet Explorer (versions 3 and later). For users of Netscape Navigator to be able to see ActiveX controls, they need to download and install the ScriptActive plug-in from Ncompass Labs (http://www.ncompasslabs.com).
Because ActiveX is the newest of the technologies discussed in this hour, you must use the new <object> tag to insert it into a page.
As Figure 18.3 shows, an ActiveX <object> tag looks rather bizarre.
Figure 18.3 The <object> tag on this page embeds an ActiveX control.
The bizarre part is the classid attribute, which must include a unique identifier for the specific ActiveX control you are including. If you use an automated program, such as Microsoft's ActiveX Control Pad, to create your ActiveX pages, it will figure out this magic number for you. Otherwise, you need to consult the documentation that came with the ActiveX control to find the correct classid.
As if the long string of gibberish in classid weren't enough, the id attribute must include another unique identifier, but this time you get to make it up. You can use any label you want for id, as long as you don't use the same label for another ActiveX control in the same document. (id is used for identifying the control in any scripts you might add to the page.)
The <param /> tags work the same with <object> as they do with the <applet> tag, discussed earlier in this hour: They provide settings and options specific to the particular ActiveX control you are placing on the Web page, with name identifying the type of information and value giving the information itself. In the example from Figure 18.3, <param /> tags are used to specify the alignment, orientation, font, and color of some text to be displayed by the Label control. This is one of many ActiveX controls built into Microsoft Internet Explorer 4 and documented at the Microsoft Developer Network Web site at http://www.microsoft.com. (Internet Explorer 5 automatically downloads the control from the Microsoft Web site upon demand.)
Notice that nothing in the HTML itself gives any clue as to what the ActiveX control on that page actually looks like or does. Only when you view the page, shown in Figure 18.4, do you see that it is a nifty little program that displays rotated text.
Figure 18.4 The ActiveX control on this page is a program for displaying fancy text, although you wouldn't know it by looking at the HTML in Figure 18.3.
Using ActiveX to Embed a Video | Next Section

Account Sign In
View your cart