diff --git a/www/emulab_sup.js b/www/emulab_sup.js index 3eaa27241fef205e802f90e436952a4afbec3688..b410415566d175ee4f1c8a73f63c3e4793ab74ad 100644 --- a/www/emulab_sup.js +++ b/www/emulab_sup.js @@ -24,3 +24,13 @@ function PageReplace(URL) window.location.replace(URL); } +function IframeDocument(id) +{ + var oIframe = document.getElementById(id); + var oDoc = (oIframe.contentWindow || oIframe.contentDocument); + + if (oDoc.document) { + oDoc = oDoc.document; + } + return oDoc; +} diff --git a/www/mungelog.js b/www/mungelog.js index 88de28a88c270feaa41b2ade0e02eb781a2fff58..470836c778ca73af88dd7e1dd65ca3b31bc09370 100644 --- a/www/mungelog.js +++ b/www/mungelog.js @@ -162,9 +162,9 @@ function ml_getScrollHeight() { */ function ml_handleReadyState(state) { var Iframe = document.getElementById('outputframe'); - var idoc = Iframe.contentWindow.document; - var oa = Iframe.contentWindow.document.getElementById('outputarea'); - var dl = document.getElementById('downloader'); + var idoc = IframeDocument('outputframe'); + var oa = idoc.getElementById('outputarea'); + var dl = document.getElementById('downloader'); if ((rt = ml_getBodyText(dl)) == null) { /* @@ -353,8 +353,8 @@ function ml_handleReadyState(state) { /* See if we should scroll the window down. */ if ((h - (y + ih)) < (y == 0 ? 200 : 10)) { - Iframe.contentWindow.document.documentElement.scrollTop = nh; - Iframe.contentWindow.document.body.scrollTop = nh; + idoc.documentElement.scrollTop = nh; + idoc.body.scrollTop = nh; } } } diff --git a/www/showlogfile_sup.php3 b/www/showlogfile_sup.php3 index df3a4d42c73cba9b244e98b885df5e29e7b2870a..c090a3ecc654b320d049999e32ff747c76503089 100644 --- a/www/showlogfile_sup.php3 +++ b/www/showlogfile_sup.php3 @@ -97,6 +97,7 @@ function STARTLOG($pid, $eid) echo "