forked from Ponysearch/Ponysearch
[mod] infinite scroll: XHR requests are sent with the header "Accept: text/html".
Fix https://github.com/searx/searx-docker/issues/16
This commit is contained in:
parent
50e1fcaa5e
commit
0e7b6c9a03
1 changed files with 12 additions and 6 deletions
|
@ -5,12 +5,18 @@ $(document).ready(function() {
|
||||||
var formData = $('#pagination form:last').serialize();
|
var formData = $('#pagination form:last').serialize();
|
||||||
if (formData) {
|
if (formData) {
|
||||||
$('#pagination').html('<div class="loading-spinner"></div>');
|
$('#pagination').html('<div class="loading-spinner"></div>');
|
||||||
$.post('./', formData, function (data) {
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
url: './',
|
||||||
|
data: formData,
|
||||||
|
dataType: 'html',
|
||||||
|
success: function(data) {
|
||||||
var body = $(data);
|
var body = $(data);
|
||||||
$('#pagination').remove();
|
$('#pagination').remove();
|
||||||
$('#main_results').append('<hr/>');
|
$('#main_results').append('<hr/>');
|
||||||
$('#main_results').append(body.find('.result'));
|
$('#main_results').append(body.find('.result'));
|
||||||
$('#main_results').append(body.find('#pagination'));
|
$('#main_results').append(body.find('#pagination'));
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue