Support Forums

The forums are closed and will be removed when we launch our new site.

Looking for support? You can access the support system via your account.

Forums Forums Search & Filter Pro Ajax search back button not refreshing results

Viewing 8 posts - 1 through 8 (of 8 total)
  • Nick Sotiriadis
    #258586

    Hello,

    shouldn’t the ajax search results update when using the browser back button?

    NS

    Trevor Moderator
    #258592

    No, because the browser will not record the changes made by the Ajax JavaScript and won’t know what state to return the page to. The browser back button is a quite inefficient system (most browsers now have the ability to allow the user to further disable the back button functionality). You will notice many sites (that use Ajax) now have warnings not to use the back button when completing forms.

    Nick Sotiriadis
    #258659

    So… what’s the point of changing the url query cars if the back button is not working?

    If the back button doesn’t work then Ajax is useless. Are there any workarounds?

    Trevor Moderator
    #258733

    The back button in the browser stores the actually submitted URL made by the user.

    When the URL changes in using our plugin (in Ajax mode), the URL is not being submitted, instead it is being changed using JavaScript, and Back Buttons do not record this. It is simply how Back Buttons work in Browsers, they do not record Ajax submissions.

    We would actually need to (be able) to access that Back Button list to add what the Ajax has done, but, all modern browsers are actually locking down this ability to stop malicious abuse of this as it can be used by hackers to redirect users to fake sites without them knowing.

    Any potential workaround typically opens up a can of worms with regard to security, as they would involve using JavaScript to send data, which is not secure.

    If your application needs to be able to use the Back Button, then you should not use Ajax.

    Nick Sotiriadis
    #258768

    Ever since HTML5 there has been history.pushState() and history.popstate().

    Essentially on every ajax call you send a pushState call and then you can use that when using the back button – and it can be developed with minimum effort since you are already changing the url hash – so in every use of back button you could trigger an ajax request based on the hash.

    Adding link for reference:
    https://developer.mozilla.org/en-US/docs/Web/API/Window/popstate_event

    Trevor Moderator
    #258773
    This reply has been marked as private.
    Ross Moderator
    #258777

    Hi again, we’ve already developed that in v3… it was a long outstanding issue…

    Thanks

    Nick Sotiriadis
    #258781

    Thanks! Can’t wait for v3 to be released!

Viewing 8 posts - 1 through 8 (of 8 total)

The forum ‘Search & Filter Pro’ is closed to new topics and replies.