Skip to content

Instantly share code, notes, and snippets.

@yuanchuan
Created March 14, 2011 09:30
Show Gist options
  • Save yuanchuan/868937 to your computer and use it in GitHub Desktop.
Save yuanchuan/868937 to your computer and use it in GitHub Desktop.
self-closed iframe problem
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>Test -- self-closed iframe problem</title>
<script>
/* quick and dirty */
function log(info) {
return window.console
? console.log.apply(console,arguments)
: alert(info);
}
</script>
</head>
<body>
<div id="wrapper">
<iframe src=""></iframe>
<script>log('everything is ok so far');</script>
<iframe src="" />
<!-- this script tag will disappear in the dom tree-->
<script>log('after self-closed iframe');</script>
<!-- so will this tag -->
<p>am i shown?</p>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment