All pastes #840417 Raw Edit

k4st

public html v1 · immutable
#840417 ·published 2007-12-31 20:40 UTC
rendered paste body
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head>    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>    <title>Blah</title></head><body><iframe src="http://ioreader.com" width="500" height="500" frameborder="yes" name="frame" id="frame"></iframe><script type="text/javascript">function onReady(fn, win, doc) {        win = win || window;    doc = doc || document;        // Dean Edwards/Matthias Miller/John Resig    var init = function() {        // quit if this function has already been called        if (arguments.callee.done) return;        // flag this function so we don't do the same thing twice        arguments.callee.done = true;        // kill the timer        if (_timer) clearInterval(_timer);        // do stuff        fn(doc);    };    /* for Mozilla/Opera9 */    if (doc.addEventListener)        doc.addEventListener("DOMContentLoaded", init, false);    /* for Internet Explorer */    /*@cc_on @*/    /*@if (@_win32)    doc.write("<script id=__ie_onload defer src=javascript:void(0)><\/script>");    var script = doc.getElementById("__ie_onload");    script.onreadystatechange = function() {        if (this.readyState == "complete") {            init(); // call the onload handler        }    };    /*@end @*/    /* for Safari */    if (/WebKit/i.test(navigator.userAgent)) { // sniff        var _timer = setInterval(function() {            if (/loaded|complete/.test(doc.readyState)) {                init(); // call the onload handler            }        }, 10);    }    /* for other browsers */    win.onload = init;}function getIframeDocument(iframe, doc) {    doc = doc || document;    var ie = /*@cc_on!@*/false;    var iframe_doc,         iframe_win;        if(!iframe)        return;        iframe_win = ie ? doc.frames[iframe_id] : iframe.contentWindow;    if(!iframe_win)        return;            iframe_doc  = iframe_win.document;     if(!iframe_doc && ie && iframe.contentWindow)        iframe_doc = iframe.contentWindow.document;            return iframe_doc;}onReady(function() {        setTimeout(function(){                alert("loaded!");                var iframe = doc.getElementById(iframe_id),            doc = getIframeDocument(iframe),             dm;                /* try to put the document into design mode */        if(typeof(document.designMode) != 'undefined')            dm = doc.designMode = "On";        else if(typeof(iframe.contentDocument.designMode) != 'undefined')            dm = iframe.contentDocument.designMode = "on";        else if(typeof(iframe.contentEditable) != 'undefined')            dm = iframe.contentEditable = true;                if(dm) {            alert("in edit mode.");        }    }, 1000);});</script></body>