What is Iframe?
An Iframe also called as Inline frame, is a HTML element that loads another HTML page within the document. It essentially puts another webpage within the parent page. They are commonly used for advertisements, embedded videos, web analytics and interactive content.
<iframe src="URL" title="description"></iframe>
Attributes value: It contains a single value URL that specifies the URL of the document that is embedded in the iframe. There are two types of URL links which are listed below:
Absolute URL: It points to another webpage.
Relative URL: It points to other files of the same web page.
<!DOCTYPE html> <html> <body> <h1>The iframe element</h1> <iframe src="https://www.thetechplatform.com/" title="The Tech Platform"> </iframe> </body> </html>
The browser allocates some space for an inline frame beforehand and takes this into account when rendering the document.
Iframes implement the cross domain origin policy which can be useful for pulling in sites / content/Ad from other domain names and they are also relatively safe and that is why most of the web advertising solutions are based on iframes.
If contents to be loaded first and then Ads , it can be done using Iframe.
Iframe helps in improving performance.
Iframe loads independently from other components on the page.
An iframe tag has attributes “height” and “width,” which allows the designer great latitude with dimensions and format like 300×250 , 728×90 depending on the Ad size.
Iframe tag can appear anywhere on the page and several iframes can be added if wished to.
It causes accessibility problems.
It is not supported by all the browsers and can display them improperly or even can serve blank.
The main reason for using in web advertisement is security in cross domain support but performance is not perfect.
Iframes can not be seen by many handhelds.
It lowers your SEO score at times.
There are restrictions on the types of campaigns you can host-for example, expandable ads without scrolling content.
If you have multiple ad units on one page, you cannot merge campaigns.
Advertisers avoid using iframes, because using false impressions makes it easier to manipulate the system
What is Script?
<script> Script Contents... </script>
Attributes: Many attribute associated with script tag.
async: It is used to specify the script is executed asynchronously.
charset: It is used to specify the character encoding used in an external script file.
defer: It is used to specify that the script is executed when the page has finished parsing.
src: It is used to specify the URL of an external script file.
type: It is used to specify the media type of the script.
The majority of browsers supports Jscript.
Multiple ad sizes can be served using same serving code at same place ,(e.g. 468×60 and 728×90)
It puts less load on the server to load.
It is supported by almost all handhelds.
No accessibility issue.
They are not loaded independently of the content in a webpage
The Tech Platform