diff --git a/js/ajax.js b/js/ajax.js
index 0ac45f9bdb..902eea3d4b 100644
--- a/js/ajax.js
+++ b/js/ajax.js
@@ -247,9 +247,11 @@ var AJAX = {
.not('#session_debug')
.remove();
// Replace #page_content with new content
- $('#page_content').replaceWith(
- "
" + data.message + "
"
- );
+ if(data.message && data.message.length > 0) {
+ $('#page_content').replaceWith(
+ "" + data.message + "
"
+ );
+ }
if (data._selflink) {
$('#selflink > a').attr('href', data._selflink);
diff --git a/tbl_chart.php b/tbl_chart.php
index 3b4acb6060..5031b63799 100644
--- a/tbl_chart.php
+++ b/tbl_chart.php
@@ -120,7 +120,7 @@ url_query = '';
-