fixed IE8 bug (page title change not allowed).
[psensor.git] / www / psensor.js
index 01ab6b3..b002c41 100644 (file)
@@ -100,11 +100,19 @@ function update_chart(chart_id, title, data) {
     var measures, data_chart, date, entry;
     var style;
 
+    $("#"+chart_id).html("");
+
     measures = data["measures"];
     data_chart = [];
     
+    $("h1").html("");
     $("h1").append(data["name"]);
-    $("title").append(data["name"]);
+
+    try {
+       $("title").html(data["name"]);
+    } catch(ignore) {
+       // IE8 doesn't allow to modify the page title
+    }
     
     $.each(measures, function(i, item) {
         value = item["value"];
@@ -146,6 +154,7 @@ function update_chart(chart_id, title, data) {
        } ]
     };
 
+
     $.jqplot (chart_id, [data_chart], style);
 }