summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDalf <alex@al-f.net>2019-12-11 14:34:25 +0100
committerDalf <alex@al-f.net>2019-12-11 14:34:25 +0100
commit0e7b6c9a032d67bf5cbdcfc062d8466c18a62abd (patch)
tree46fcb9396cb0954bda45f667ad23d5b62d428cd1
parent50e1fcaa5e7369a64829552fc96cd24c787706c9 (diff)
downloadsearxng-0e7b6c9a032d67bf5cbdcfc062d8466c18a62abd.tar.gz
searxng-0e7b6c9a032d67bf5cbdcfc062d8466c18a62abd.zip
[mod] infinite scroll: XHR requests are sent with the header "Accept: text/html".
Fix https://github.com/searx/searx-docker/issues/16
-rw-r--r--searx/static/plugins/js/infinite_scroll.js18
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'));
+ }
});
}
}