Fill in #switchmenu using JQuery calls instead of HTML text.
authorMike Taylor <mike@indexdata.com>
Tue, 18 Jun 2013 15:37:30 +0000 (16:37 +0100)
committerMike Taylor <mike@indexdata.com>
Tue, 18 Jun 2013 15:37:30 +0000 (16:37 +0100)
experiments/spclient/mkws.js

index 65e6219..b23e043 100644 (file)
@@ -377,9 +377,13 @@ $(document).ready(function() {
     var jqxhr = jQuery.get("/service-proxy-auth")
        .fail(function() { alert("service proxy authentifiction failed"); });
 
-    // Less code needs to be included in the HTML client
-    $('#switchmenu').html('\
-      <a href="#" onclick="switchView(\'recordview\')">Record Browser</a>\
-      <span> | </span>\
-      <a href="#" onclick="switchView(\'targetview\')">Target Info</a>');
+    $("#switchmenu").html($("<a/>", { href: '#',
+                                     onclick: "switchView(\'recordview\')",
+                                     text: "Record Browser",
+                                   }));
+    $("#switchmenu").append($("<span/>", { text: " | " }));
+    $("#switchmenu").append($("<a/>", { href: '#',
+                                       onclick: "switchView(\'targetview\')",
+                                       text: "Target Info",
+                                     }));
 });