I’m using a hidden iframe to sandbox some javascript functions. I’d like to know which headers are recommended to include in the iframe. I’m looking to cut anything not needed: the title, meta tags, etc.
1) Is it advisable to simply use <html><body></body></html> since the document contains nothing other than javascript? (Are there any gotchas I should be aware of in doing this?)
2) if I cut out language and encoding declarations and return utf-8 characters from the iframe to the parent window (which has the headers below), will those characters be displayed correctly?
Thanks!
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.1//EN' 'http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='eng' lang='en'>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<title>New Site</title>
<meta name='Description' content='Website Under Construction' />
</head>
<body>
</body>
</html>
You can use HTML5 instead of XHTML: