diff core.js @ 1202:27be75c51b5c

Bug #1607, #1608 and #1610 fixes.
author Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk>
date Mon, 22 Feb 2016 14:38:45 +0000
parents 4560587673b4
children 1f352095179e
line wrap: on
line diff
--- a/core.js	Mon Feb 22 14:20:50 2016 +0000
+++ b/core.js	Mon Feb 22 14:38:45 2016 +0000
@@ -147,6 +147,15 @@
 		r.onload = function() {
 			loadProjectSpecCallback(r.response);
 		};
+        r.onerror = function() {
+            document.getElementsByTagName('body')[0].innerHTML = null;
+            var msg = document.createElement("h3");
+            msg.textContent = "FATAL ERROR";
+            var span = document.createElement("p");
+            span.textContent = "There was an error when loading your XML file. Please check your path in the URL. After the path to this page, there should be '?url=path/to/your/file.xml'. Check the spelling of your filename as well. If you are still having issues, check the log of the python server or your webserver distribution for 404 codes for your file.";
+            document.getElementsByTagName('body')[0].appendChild(msg);
+            document.getElementsByTagName('body')[0].appendChild(span);
+        }
 		r.send();
 	};
 	xmlhttp.send();