piskel/cheap-partials.js

7 lines
314 B
JavaScript
Raw Normal View History

2013-08-11 03:26:38 +04:00
// SUPER CHEAP TEMPLATES !
window._ctl = function (event) {
var iframe=event.target || event.srcElement, div=document.createElement("div");
div.innerHTML = iframe.contentWindow.document.body.innerHTML;
if (div.children.length == 1) div = div.children[0];
iframe.parentNode.replaceChild(div, iframe);
};