diff --git a/explorer.php b/explorer.php
index b2417b136bf5da900beb8277046ddba353a5db6a..8081c444392db3cb6fd43ab4ca48e69bb17c6dc1 100644
--- a/explorer.php
+++ b/explorer.php
@@ -21,20 +21,20 @@
       href="<?php echo $rootpath?>/css/style.css" />
 	<!--}}}-->	
   </head>
-  <body onload="javascript:Explosurf.explorer.init(
+  <body>
+    <div class="hidden" id="planet-file">
     <?php 
     // get the XML planet descriptor
     $search = glob("*.xml") ;
     $len = count($search) ;
     if($len > 0) {
       $file = $search[0] ;
-      echo "'$file'" ;
+      echo $file ;
     } else {
       echo "" ;
     }
     ?>
-    );" 
-    >
+    </div>
     <div class="container">
       <!--{{{ top bar-->
       <div class="navbar navbar-default">
diff --git a/js/explorer.js b/js/explorer.js
index 3a617db750830fb287782efa0da8c6986fc942b6..44ced0cff23c93263b1252500c092820a558d2af 100644
--- a/js/explorer.js
+++ b/js/explorer.js
@@ -127,7 +127,9 @@ function openXML(filename, handler) {
   xhttp.addEventListener("error", handle_request_error);
   xhttp.addEventListener("readystatechange", function() {handler(this);});
   xhttp.open("GET",filename) ;
-  xhttp.overrideMimeType('text/xml');
+  if(xhttp.overrideMimeType) {
+    xhttp.overrideMimeType('text/xml');
+  }
   xhttp.send(null) ;
 }
 
@@ -260,7 +262,8 @@ function check_boundary(edge) {
 /*export*/
 Xpl.check_boundary = check_boundary ;
 
-function init(filename) {
+function init() {
+  var filename = document.getElementById('planet-file').innerHTML ;
   openXML(filename, function(response) {
     if (response.readyState == 4 && response.status == 200) {
       load_planet(response.responseXML) ;
@@ -270,6 +273,7 @@ function init(filename) {
   }) ;
 }
 
-Xpl.init = init
+document.addEventListener("DOMContentLoaded", init) ;
+
 
 }) //end of namespace
diff --git a/js/pgm_construction.js b/js/pgm_construction.js
index e0a05eb741dd17587e6e9ced318dcc1e8094fc7a..a44a7297d9b9ac4c893efdcf29a4ea2d9d4f0c29 100644
--- a/js/pgm_construction.js
+++ b/js/pgm_construction.js
@@ -196,7 +196,7 @@ document.getElementById('pgm-load-local').addEventListener(
     for(var i = 0; i < pgm_list.children.length; ++i) {
       var item = pgm_list.children[i] ;
       if(item.className.match(/active/)) {
-        var name = item.children[1].innerText ;
+        var name = item.children[1].innerHTML ;
         local_load('Explosurf:all:pgm:' + name) ;
       }
     }