web/data/cubicweb.htmlhelpers.js
changeset 7069 8bf2337a6f3b
parent 6858 393300fc3fdd
child 8238 087bb529035c
--- a/web/data/cubicweb.htmlhelpers.js	Thu Mar 10 11:58:57 2011 +0100
+++ b/web/data/cubicweb.htmlhelpers.js	Thu Mar 10 12:03:37 2011 +0100
@@ -16,11 +16,15 @@
  * available and inspects the <base> tag manually otherwise.)
  */
 function baseuri() {
-    var uri = document.baseURI;
-    if (uri) { // some browsers don't define baseURI
-        return uri.toLowerCase();
+    if (typeof BASE_URL === 'undefined') {
+        // backward compatibility, BASE_URL might be undefined
+        var uri = document.baseURI;
+        if (uri) { // some browsers don't define baseURI
+            return uri.toLowerCase();
+        }
+        return jQuery('base').attr('href').toLowerCase();
     }
-    return jQuery('base').attr('href').toLowerCase();
+    return BASE_URL;
 }
 
 /**