diff options
author | Markus Heiser <markus.heiser@darmarIT.de> | 2020-01-28 11:04:02 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-28 11:04:02 +0000 |
commit | 54675c7690bdd00388636caea663ae09b5910d6c (patch) | |
tree | d8461b0392143da9d8ec9ae598b8a12c50914104 | |
parent | bda189565589b0065152f5a9fba4565404f9bd9a (diff) | |
parent | e64ff38217a1ba49afd4bb1c595121d94cbb2e33 (diff) | |
download | searxng-54675c7690bdd00388636caea663ae09b5910d6c.tar.gz searxng-54675c7690bdd00388636caea663ae09b5910d6c.zip |
Merge pull request #1766 from dalf/fix-infinite-scroll
[mod] infinite scroll: XHR requests are sent with the header "Accept: text/html"
-rw-r--r-- | searx/static/plugins/js/infinite_scroll.js | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/searx/static/plugins/js/infinite_scroll.js b/searx/static/plugins/js/infinite_scroll.js index 1a95756a0..db84a6908 100644 --- a/searx/static/plugins/js/infinite_scroll.js +++ b/searx/static/plugins/js/infinite_scroll.js @@ -5,12 +5,18 @@ $(document).ready(function() { var formData = $('#pagination form:last').serialize(); if (formData) { $('#pagination').html('<div class="loading-spinner"></div>'); - $.post('./', formData, function (data) { - var body = $(data); - $('#pagination').remove(); - $('#main_results').append('<hr/>'); - $('#main_results').append(body.find('.result')); - $('#main_results').append(body.find('#pagination')); + $.ajax({ + type: "POST", + url: './', + data: formData, + dataType: 'html', + success: function(data) { + var body = $(data); + $('#pagination').remove(); + $('#main_results').append('<hr/>'); + $('#main_results').append(body.find('.result')); + $('#main_results').append(body.find('#pagination')); + } }); } } |