don't use absolute path for ?lang=<...> links
[mkws-moved-to-github.git] / experiments / spclient / mkws.js
index 0db3796..43804bf 100644 (file)
@@ -1,7 +1,7 @@
 /* A very simple client that shows a basic usage of the pz2.js
 */
 
-// "use strict"; // HTML5
+"use strict"; // HTML5: disable for debug >= 2
 
 // global config object mkws_config 
 if (!mkws_config)
@@ -657,7 +657,7 @@ function mkws_html_lang(mkws_config) {
        if (lang == l) {
            data += l;
        } else {
-           data += ' <a href="/?lang=' + l + '">' + l + '</a> '
+           data += ' <a href="?lang=' + l + '">' + l + '</a> '
        }
     }
     
@@ -690,9 +690,8 @@ jQuery.extend({
 function debug(string) {
     if (!mkws_debug)
        return;
-   
-    var console; // IE8 quirks 
-    if (!console) { /* ARGH!!! */
+
+    if (typeof console === "undefined" || typeof console.log === "undefined") { /* ARGH!!! */
        return;
     }