Skip to content Skip to sidebar Skip to footer

Moving Back Webpages With Javascript

Ok this is the issue. I am working in a popup. We go from Page 1 to Page 2. Page 2 has frames set up on it. I know it's bad but it was not my decisions. Now on Page 2 in one frame

Solution 1:

An easy way is to link to the page you want directly instead of using history.go. Alternatively, you can try to use parent.history.go(-1).

A third thing you may try, if you have complete control over all the links in the inner frame is to always use location.replace from the inner frame, which will not add an entry into the history, something like the following script

$(function() {
    $('a').click(function(e) {
        e.preventDefault();
        location.replace(this.href);
    });
});

Post a Comment for "Moving Back Webpages With Javascript"