]> git.joonet.de Git - adminer.git/commitdiff
JUSH may be unreachable in IE
authorjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Fri, 11 Sep 2009 19:45:56 +0000 (19:45 +0000)
committerjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Fri, 11 Sep 2009 19:45:56 +0000 (19:45 +0000)
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1097 7c3ca157-0c34-0410-bff1-cbf682f78f5c

adminer/editing.js

index d2bceed3ab25d98e5d2901655084a86f0c95cd3a..ce05f768ca465c8ef9529406d8059930abc80117 100644 (file)
@@ -5,12 +5,14 @@ function body_load() {
        var script = document.createElement('script');
        script.src = jush_root + 'jush.js';
        script.onload = function () {
-               jush.style(jush_root + 'jush.css');
-               jush.highlight_tag('pre');
-               jush.highlight_tag('code');
+               if (this.jush) { // IE runs in case of an error too
+                       jush.style(jush_root + 'jush.css');
+                       jush.highlight_tag('pre');
+                       jush.highlight_tag('code');
+               }
        }
        script.onreadystatechange = function () {
-               if (script.readyState == 'loaded' || script.readyState == 'complete') {
+               if (/^(loaded|complete)$/.test(script.readyState)) {
                        script.onload();
                }
        }