Objects in HTML
Overview of objects (applets, flash move, etc) that can be embedded in your website and outlines the steps how it is done.
HTML code allows users to embed objects in the markup. The object may be a Java applet, a FLASH animation, an activex control or any other application that carries out custom functions or plays multimedia video/audio files. Linking a multimedia file using the '<a>' tag will just play the audio or video on the user's default multimedia player. The following tags allow users to play music in the background or play animations without leaving the page they are browsing. The programs should first be created and tested before being used in an HTML document. Embedding large objects may cause the page to load very slowly. The 'param' tags contain required program and input parameters.
A Java Applet
<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" width="400" height="400"> <PARAM name="code" value="myapplet.class"> <param name="input1" value="somevalue"> </OBJECT>
Note: The class ID refers to the version of the Java Plug In that should be used to run the applet.
A Flash Movie
<pre class=samplecode> <object width="700" height="600"> <param name="movie" value="myflash.swf"> </object>
Mailto Links
A simple way to allow users to contact a website is to include a 'mailto' link. A mailto link has been incorporated into the florist home page with the following HTML markup:
I Hope you have a great shopping experience with us. Do keep coming back! Also, please take a moment to give us your <a href="mailto:someone@someplace.com">valuable suggestions and comments.</a>
A 'mailto' link, when clicked, opens up the default mail browser of the user's computer (it may be Microsoft outlook, yahoo mail, msn, or any other). A mail composition dialogue on this default mail program with the 'send to' field set to the e-mail address specified in the 'mailto' link is opened. Clicking on the above mailto link will open a mail composition window with the recipient's address set to someone@someplace.com
ScreenShot 4g: MailTo with Microsoft Outlook Default Mail Program
We have now learnt a lot about static HTML elements and forms. It is time to move on to dynamic display using programs. In the next two chapters, we will write scripts that validate the data users enter into our forms and master some Dynamic HTML tricks using the document-object model. Using this model, The entire HTML document may be visualized as an object containing other objects made up of individual HTML elements. This view of the HTML document serves as a foundation for monitoring web form content and changing web pages dynamically.