Skip to content

Commit

Permalink
use native trim & json functions
Browse files Browse the repository at this point in the history
  • Loading branch information
notslang committed Aug 27, 2014
1 parent df5d289 commit c0475de
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
10 changes: 0 additions & 10 deletions asset/js/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,3 @@ function wpsdb_add_commas(number_string) {
}
return x1 + x2;
}

function wpsdb_parse_json(maybe_json) {
try {
var json_object = jQuery.parseJSON(maybe_json);
} catch (e) {
// we simply return false here because the json data itself will never just contain a value of "false"
return false;
}
return json_object;
}
8 changes: 4 additions & 4 deletions asset/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -1123,10 +1123,10 @@ var execute_next_step;
},
success: function(data) {
doing_ajax = false;
data = $.trim(data);
row_information = wpsdb_parse_json(data);
if (false == row_information || null ==
row_information) {
data = data.trim();
try {
row_information = JSON.parse(data);
} catch (variable) {
$('.progress-title').html('Migration failed');
if ('' == data || null == data) {
$('.progress-text').html(wpsdb_i10n.table_process_problem_empty_response +
Expand Down

0 comments on commit c0475de

Please sign in to comment.