Click here to hide categories Click here to show left categories

User: Home          welcome : Guest          Log In / Register here     




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">
//<![CDATA[
document.write('<iframe id="datamain" src="'+iframesrc+'" width="190px" height="80px" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no"></iframe>')
//]]>
</script>

Share this article   |    Print    |    Article read by 928 times
Author:
Rohit kakria
I am software developer, moderator of xpode.com
Related Articles: No related article
Related Interview Questions: No related interview question