I
I
ImagineWorld2020-07-09 13:13:18
JavaScript
ImagineWorld, 2020-07-09 13:13:18

How to follow links without reloading?

My content is loaded dynamically without reloading when clicking on menu items.
I did like this:

$('.payments-reports').click(function(){
        History.pushState(null, document.title, '=1');;
        $(this).attr('class','sidebarDropMenuActive');
        onLoad.paymentsReportsRender();
        
      });


When clicking on .payments-reports, an html element is rendered with the data received by AJAX and '=1' is added to the URL. How can I use window.history so that when the page is reloaded with url '=1', the same page is loaded that was rendered earlier? Thanks

Answer the question

In order to leave comments, you need to log in

1 answer(s)
4
420873535, 2020-07-09
@gargool

As an option, track the url and if there is "=1" load as on click.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question