diff options
author | Rouslan Placella <rouslan@placella.com> | 2012-06-09 20:46:00 +0400 |
---|---|---|
committer | Rouslan Placella <rouslan@placella.com> | 2012-06-11 17:06:05 +0400 |
commit | 971db49c1143446238157c9bf6b8fc5bed3b55fb (patch) | |
tree | 07070feac86b2bb20ef668d74ace5b5748cdb12d /js/tbl_select.js | |
parent | ef2b98dd8e12c7f7bd11de65930c69556cf0c28b (diff) |
Expect JSON for every ajax request in JavaScript
Diffstat (limited to 'js/tbl_select.js')
-rw-r--r-- | js/tbl_select.js | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/js/tbl_select.js b/js/tbl_select.js index bd50a10733..b8c9f386d5 100644 --- a/js/tbl_select.js +++ b/js/tbl_select.js @@ -52,11 +52,11 @@ $(function() { PMA_prepareForAjaxRequest($search_form); - $.post($search_form.attr('action'), $search_form.serialize(), function(response) { + $.post($search_form.attr('action'), $search_form.serialize(), function(data) { PMA_ajaxRemoveMessage($msgbox); - if (typeof response == 'string') { + if (data.success == true) { // found results - $("#sqlqueryresults").html(response); + $("#sqlqueryresults").html(data.message); $("#sqlqueryresults").trigger('makegrid'); $('#tbl_search_form') // workaround for bug #3168569 - Issue on toggling the "Hide search criteria" in chrome. @@ -71,14 +71,7 @@ $(function() { // needed for the display options slider in the results PMA_init_slider(); } else { - // error message (zero rows) - if (response.message != undefined) { - $("#sqlqueryresults").html(response['message']); - } - // other error (syntax error?) - if (response.error != undefined) { - $("#sqlqueryresults").html(response['error']); - } + $("#sqlqueryresults").html(data.error); } }); // end $.post() }); |