Xpode.com        Click here to Print this article.

w3.org validation iframe error, warning

Error : document type does not allow element "iframe" here while validating the page XHTML with w3.org

var iframesrc="external.htm"
//You may change most attributes of iframe tag below, such as width and height:

document.write( '<iframe id="datamain" src="%27+iframesrc+%27" marginwidth="0" marginheight="0" hspace="0" vspace="0" width="190px" frameborder="0" height="80px" scrolling="no"></iframe>')

Note : Do not forget to add // signs with Cdata. Without these script may stop working in some browsers To solve that We need to do only one thing.

<script type="text/javascript">
document.write('<iframe id="datamain" src="'+iframesrc+'" width="190px" height="80px" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no"></iframe>')


Contributed by:
Rohit kakria
I am software developer, moderator of xpode.com

Resourse address on xpode.com

Click here to go on website