public
Created

Load into JSFiddle

  • Download Gist
2fiddle.js
JavaScript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
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();
}
frame.html
HTML
1 2 3 4 5 6 7 8
<html>
<head>
</head>
<script src="2fiddle.js"></script>
<body>
<h2>Hello world</h2>
</body>
</html>

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.