Skip to content

Commit

Permalink
Replaced getJSON with an Ajax request.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mehdi Mehtarizadeh committed Apr 5, 2022
1 parent 6f02851 commit 9dd738e
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions resources/js/cafevariome/query_builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,22 @@ $(function() {
$('select#values_phen_left').empty()
var arrayToReduce = $(this).val().trim().split(' ').filter((term) => term.length != 1);
str = (arrayToReduce.length > 0) ? arrayToReduce.reduce((v1, v2) => v1 + " " + v2) : '';
$.getJSON(hpo_autocomplete_url + (str) , (data) => {
$('select#values_phen_left').empty()
data.forEach((term) => {
$('select#values_phen_left').append($('<option></option>').attr('value', term).text(term))
})
})
.fail(function() { });

$.ajax({
url: hpo_autocomplete_url + str,
type: 'GET',
dataType:'json',
crossDomain: true,
success: function (data, textStatus, jqXHR) {
$('select#values_phen_left').empty()
data.forEach((term) => {
$('select#values_phen_left').append($('<option></option>').attr('value', term).text(term))
})
}
}).done(function() {

});

$search_str = $(this).val()
})

Expand Down

0 comments on commit 9dd738e

Please sign in to comment.