Skip to content

Instantly share code, notes, and snippets.

@webxl
Created September 22, 2011 20:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save webxl/1235941 to your computer and use it in GitHub Desktop.
Save webxl/1235941 to your computer and use it in GitHub Desktop.
Load into JSFiddle
if (typeof gistJSUrl != 'undefined') {
frame = document.createElement('iframe');
body = document.getElementsByTagName('body')[0];
body.appendChild(frame);
frame.src = gistJSUrl;
form = document.createElement('form');
body.appendChild(form);
form.action = "http://jsfiddle.net/api/post/mootools/1.2/";
js= document.createElement('textarea');
form.appendChild(js);
js.innerHTML=frame.contentWindow.document.body.innerHTML;
//form.submit();
}
<html>
<head>
</head>
<script src="2fiddle.js"></script>
<body>
<h2>Hello world</h2>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment