JQuery How to use the history plugin?

I use ajax in my web application and now I need the back and forward buttons for the browser to work. So I went looking for the jquery history plugin and found this: http://stilbuero.de/jquery/history

In my code, I use the function to load the page:

function loadDocument(id, doc) { $("#DocumentContent").show(); // Clear dynamic menu items $("#DynamicMenuContent").html(""); $("#PageContent").html(""); // Load document in frame $("#iframeDocument").attr("src", 'ViewDoc.aspx?id=' + id + '&doc=' + doc + ''); // Load menu items $("#DynamicMenuContent").load("ShowButtons.aspx"); } 

As you can see, I want my pages to load in an iframe. Can someone tell me how I can use the history plugin to work with buttons? I don’t care what plug-in it is, as long as the browser buttons work. I prefer an easy to use plugin.

+3
source share
2 answers

Since I use iframe, the back and forward buttons still work! I got the impression that this will not work, because I use ajax, but it works!

0
source

I recently worked on a web application that needed to be supported back and forth in history for ajax content. I decided to go with the Ben Alman BBQ plugin found here: http://benalman.com/projects/jquery-bbq-plugin/

It is easy to use, and it has some examples of how to implement it.

+1
source

Source: https://habr.com/ru/post/1369571/


All Articles