简体   繁体   中英

Manipulating History.Back does not work as expected

In my Project I open a new page using

I use a parameter to tell the following page what is his parent. (relative path) The JS-Code is the following:

function FillHistory() {  
    var parent = getUrlVars()["parent"];
    var currentUrl = $(location).attr('href');

    History.pushState({ state: 2 }, parent, parent);
    History.pushState({ state: 2 }, currentUrl, currentUrl);
}

( getUrlVars is a method to get the GET-parameters of that URL)

Now, When I click onto the Back-Button the address of the " parent "-URL is shown in the browser, but the current page just stays there.

Any clue?

尝试这个

history.replaceState({value: 1, value2: X}, "title", "page.php");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM