Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (term.length > 2) {
- console.info('term: ', term)
- debugger;
- fetch('url' + term + ' &otherparameters etc.', {
- method: 'GET',
- headers: {
- 'Content-Type': 'application/json'
- }
- })
- .then(res => res.json())
- //.then(data => console.info('ArrayOfAramaResult: ', data.ArrayOfAramaResult.AramaResult))
- .then(data => data.ArrayOfAramaResult.AramaResult, () => {
- $(searchResultsContainer).html("");
- $.each(data, function (indis, item) {
- var ekle = $('<div><a href="#">' + item.xxxxxx + ", " + item.yyyyyy + '</a></div>');
- $(searchResultsContainer).append(ekle);
- ekle.find("a").click(function () {
- $("#search-input").val(item.xxxxxx + ", " + item.yyyyyy);
- _zoom(item.LON, item.LAT);
- $('#searchResults').removeClass("in");
- return false;
- });
- });
- })
- .catch(error => console.error('Error:', error));
- }
- else {
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement