I am using pagination with ajax.
When i click on any page number url not changing because of ajax call
So when i click on page 3 and then click on page 7
i hit the back button it returns to page 1 because url never changing
Here is my code:
property_paging: function() {
var handle = true;
$('.paging-navigation', '.property-paging-wrap').each(function () {
$('a', $(this)).off('click').on('click', function (event) {
event.preventDefault();
if(handle) {
handle = false;
var $this = $(this);
var href = $this.attr('href'),
data_paged = ERE.get_page_number_from_href(href),
data_contain = $this.closest('.property-paging-wrap'),
property_content = $this.closest('.ere-property').find('.property-content');
$.ajax({
url: data_contain.data('admin-url'),
data: {
action: 'ere_property_paging_ajax',
layout: data_contain.data('layout'),
items_amount: data_contain.data('items-amount'),
columns: data_contain.data('columns'),
image_size: data_contain.data('image-size'),
columns_gap: data_contain.data('columns-gap'),
view_all_link: data_contain.data('view-all-link'),
paged: data_paged,
property_type: data_contain.data('property-type'),
property_status: data_contain.data('property-status'),
property_feature: data_contain.data('property-feature'),
property_city: data_contain.data('property-city'),
property_state: data_contain.data('property-state'),
property_neighborhood: data_contain.data('property-neighborhood'),
property_label: data_contain.data('property-label'),
property_featured: data_contain.data('property-featured'),
author_id: data_contain.data('author-id'),
agent_id: data_contain.data('agent-id')
},
success: function (html) {
var $newElems = $('.property-item', html),
paging = $('.property-paging-wrap', html);
property_content.css('opacity', 0);
property_content.html($newElems);
ERE.set_item_effect($newElems, 'hide');
var contentTop = property_content.offset().top - 30;
$('html,body').animate({scrollTop: +contentTop + 'px'}, 500);
property_content.css('opacity', 1);
property_content.imagesLoaded(function () {
$newElems = $('.property-item', property_content);
ERE.set_item_effect($newElems, 'show');
property_content.closest('.ere-property').find('.property-paging-wrap').html(paging.html());
ERE.property_paging();
ERE.property_paging_control();
ERE.favorite();
ERE.tooltip();
ERE_Compare.register_event_compare();
});
handle = true;
},
error: function () {
handle = true;
}
});
}
})
});
},
the subject is a bit important. and my time is short. is there anyone who can help??
How we can insert header and footer in google docs with google docs api using PHP code
Writing a new and appending a file in PHP without erasing contents
How to combine 2 arrays with the condition that 2 and 5 values will be from the second array?
How to keep the ?error on url if page extension not included?
I have a spring bath application which contains a batch configurationI want to dynamically load profile based upon the environemnt variable parameter of active profile list
A very useful guide and code snippet is provided for using setForegroundAsync() for a long-running worker in the context of a Worker in WorkManager
I am finding it hard to consume data from the API i hosted on heroku using Axios