Advertisement
Guest User

Untitled

a guest
Aug 19th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. if (term.length > 2) {
  2. console.info('term: ', term)
  3. debugger;
  4. fetch('url' + term + ' &otherparameters etc.', {
  5. method: 'GET',
  6. headers: {
  7. 'Content-Type': 'application/json'
  8. }
  9. })
  10. .then(res => res.json())
  11. //.then(data => console.info('ArrayOfAramaResult: ', data.ArrayOfAramaResult.AramaResult))
  12. .then(data => data.ArrayOfAramaResult.AramaResult, () => {
  13. $(searchResultsContainer).html("");
  14. $.each(data, function (indis, item) {
  15.  
  16. var ekle = $('<div><a href="#">' + item.xxxxxx + ", " + item.yyyyyy + '</a></div>');
  17. $(searchResultsContainer).append(ekle);
  18.  
  19. ekle.find("a").click(function () {
  20. $("#search-input").val(item.xxxxxx + ", " + item.yyyyyy);
  21. _zoom(item.LON, item.LAT);
  22. $('#searchResults').removeClass("in");
  23. return false;
  24. });
  25. });
  26. })
  27. .catch(error => console.error('Error:', error));
  28. }
  29. else {
  30. return false;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement