Skip to content

Instantly share code, notes, and snippets.

@nfreear
Created December 6, 2012 13:46
Show Gist options
  • Save nfreear/4224545 to your computer and use it in GitHub Desktop.
Save nfreear/4224545 to your computer and use it in GitHub Desktop.
Iframe srcdoc test
<!doctype html><meta charset=utf-8 ><title>*Iframe `@srcdoc` test</title>
<style>iframe{ border:1px solid #aaa; }</style>
<h1>Iframe `@srcdoc` test</h1>
<iframe
width=400 height=300 data-X_frameborder=0
seamless data-X_sandbox
srcdoc=
"<!doctype html><hr />iframe - I'm in a `@srcdoc` attribute!
<script> alert('I\'m generated by a `@srcdoc`!'); //console.log('I\'m generated by a @srcdoc!');</script>"
>[no frames]</iframe>
<script src="https://raw.github.com/jugglinmike/srcdoc-polyfill/master/srcdoc-polyfill.js"></script>
<pre>
N.D.Freear, 2012-12-06.
* http://whatwg.org/specs/web-apps/current-work/multipage/the-iframe-element.html#attr-iframe-srcdoc
* http://peter.sh/2012/04/ui-for-date-input-fields-iframes-srcdoc-attribute-and-flexbox-updates/
* https://github.com/jugglinmike/srcdoc-polyfill
* <a href="http://validator.w3.org/check/referer">Validate - W3C</a>
</pre>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment