What are Plug-ins?
In computing, a plug-in is a software component that adds a specific feature to an existing computer program. When a program supports plug-ins, it enables customization.
The common examples are the plug-ins used in web browsers to add new features such as search-engines, virus scanners, or the ability to use a new file type such as a new video format. (src: wikipedia)
What are HTML plug-ins?
HTML plug-ins are also called as Helper applications. Plug-ins are computer programs that helps extending the standard functionality of a web browser.
The main purpose of a plug-in is to extend the functionality of the HTML browser. Plug-ins can be added to HTML pages with the <object> tag or the <embed> tag.
The main Purpose of Plug-ins are:
- display maps
- scan for viruses
- verify your bank id, etc.
How to add a Plugin to a HTML page with <object> tag?
The HTML Embedded Object Element (<object>) represents an external resource, which can be treated as an image, a nested browsing context, or a resource to be handled by a plugin.
The <object> element is supported by all browsers.
Attributes of <object> tag
Let us discuss the attributes of <object> tag:
The address of the resource as a valid URL. At least one of data and type must be defined.
The form element, if any, that the object element is associated with (its form owner). The value of the attribute must be an ID of a <form> element in the same document.
The height of the displayed resource, in CSS pixels.
The name of valid browsing context.
The content type of the resource specified by data. At least one of data and type must be defined.
This Boolean attribute indicates if the type and the actual content type resource must match in order of this one to be used.
A hash-name reference to a <map> element; that is a ‘#’ followed by the value of a name of a map element.
The width of the display resource, in CSS pixels.
<object width="300" height="50" data="abc.swf"></object>
The <object> element can also be used to include HTML in HTML as shown below:
<object width=”100%” height=”500px” data=”sample_page.html”></object>
The <object> element can also be used to include images as shown below:
The <embed> Element
The <embed> element defines an embedded object within an HTML document.
All the web browsers support <embed> element and it has been a part of HTML specification before HTML5. This element will not be validated in HTML4 page.
Attributes of <embed> tag
The displayed height of the resource, in CSS pixels.
The URL of the resource being embedded.
The MIME type to use to select the plug-in to instantiate.
The displayed width of the resource, in CSS pixels.
<embed width="300" height="50" src="abc.swf">
The <embed> element can also be used to include HTML in HTML as shown below:
<embed width=”100%” height=”500px” src=”sample_page.html”>
The <embed> element can also be used to include images as shown below: