Object element Example: How to use the mime type

This example is part of the article Add Multimedia to your Web documents, part 2.

We can decide to send a raw text file, with text/plain, to avoid to have to cut and paste the source code of your program or html web page in a pre and write things like that which are difficult to update:

<h4>An html head example</h4>
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   xml:lang="en" lang="en"&gt;
	&lt;meta http-equiv="content-type" content="text/html; charset=utf-8" /&gt;
	&lt;title&gt;Your Title&lt;/title&gt;


Example: inserting some python code

   <p>Source code of  
   <a href="/source/wiki2xhtml.py">wiki2xhtml</a></p>

Another example: presenting HTML source code

   <p>Source code of the 
   <a href="/source/example.html">HTML file</a></p>

Something to be careful of: the MIME-type sent by the server has precedence over the MIME-type given in the object element. If you don't have access to the configuration of your Web server, you could use a copy of your HTML file with a .txt extension, such as example.html.txt. Usually webservers are configured to send .txt files as text/plain; otherwise you can locally configure it to be sent as text/plain. For example, you can achieve this with a .htaccess file in Apache.