From 0e7b6c9a032d67bf5cbdcfc062d8466c18a62abd Mon Sep 17 00:00:00 2001 From: Dalf Date: Wed, 11 Dec 2019 14:34:25 +0100 Subject: [PATCH] [mod] infinite scroll: XHR requests are sent with the header "Accept: text/html". Fix https://github.com/searx/searx-docker/issues/16 --- searx/static/plugins/js/infinite_scroll.js | 18 ++++++++++++------ 1 file 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('
'); - $.post('./', formData, function (data) { - var body = $(data); - $('#pagination').remove(); - $('#main_results').append('
'); - $('#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('
'); + $('#main_results').append(body.find('.result')); + $('#main_results').append(body.find('#pagination')); + } }); } }