regen build files
[psensor.git] / www / psensor.js
index 01ab6b3..5870b2b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010-2011 jeanfi@gmail.com
+ * Copyright (C) 2010-2012 jeanfi@gmail.com
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
@@ -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);
 }