$.ajax({ type: 'GET', url: 'hobby_search.php', data: { term: txt }, dataType: 'json', // Choosing a JSON datatype success: function(data) { var JSONArray = $.parseJSON( data ); console.log(JSONArray); }, error: function() {alert("Error. Try later.");} });