A Cool Site for learning different

Sunday, August 21, 2011

HTML object includes

HTML object includes

What are includes

Includes are a way of including text files in other html files. The reason why you would want to do this is because you can update a single file and the changes would be made to all the pages that include that file in them.

Implementing Object includes

Object includes are very easy to implement especially if you have already used the other types of includes before.
Object includes use the <object> tag to include another file. The following example code includes a file with the code for a website menu:
<object data="menu.html" type="text/html"><object> Once the line has been added to all your pages you will be able to update the menu file and all you pages will show the new menu without you having to update them each manually.

Problems with object includes

The biggest problem with object includes is that people need a html 4.0 compliant browser and text browsers ignore the object tag because it is usually used for multimedia content which they can't display. Search engines use a text browser to index you pages which means they can't read the content that is included with the object tag.
Even though it has these problems it can still be useful if it is used in the right situation.