changing the destination of the "Back" button? - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

changing the destination of the "Back" button?

kvarnstenkvarnsten Posts: 47Member
I am using a forwarding url for one of my websites, but have to have the browser's "Back" button reach the previous web page visited instead of the forwarding url that instantly again will forward to the current page.

Can this be done using java script?

many thanks,


Matt

Comments

  • WeirdofreakWeirdofreak Posts: 439Member
    Don't think so, unless you use an ActiveX plugin, which is incompatible with anything that isn't IE.

    Some browsers will ignore forwarding pages for purposes of the back button, especially if you use the meta tag to do it, or you could make a back link, although I can't remember offhand what you need to do to go back two pages.
  • zibadianzibadian Posts: 6,349Member
    : Don't think so, unless you use an ActiveX plugin, which is incompatible with anything that isn't IE.
    :
    : Some browsers will ignore forwarding pages for purposes of the back button, especially if you use the meta tag to do it, or you could make a back link, although I can't remember offhand what you need to do to go back two pages.
    :
    That code is if memory serves me well:
    [code]
    history.back(2);
    [/code]
    or you can use
    [code]
    history.go(-2);
    [/code]
  • kvarnstenkvarnsten Posts: 47Member

    : That code is if memory serves me well:
    : [code]
    : history.back(2);
    : [/code]
    : or you can use
    : [code]
    : history.go(-2);
    : [/code]
    :

    But if I have to have the back button to work, shouldnt it be possible to have the webpage itself presented in some kind of java window, applet based or not. And if so the backbutton would work right? Cause anything loaded in an appplet window wouldnt be affected by the history order right?


    Matt
  • WeirdofreakWeirdofreak Posts: 439Member
    I may not have my terminology right here, plus I'm not at all sure I understood you correctly, but I'll try:

    A Java Applet, which would appear in the browser window, wouldn't be affected by the back/forward buttons, but the window itself would. So if you go to x.com, which has a Java applet, from y.com and go from there to z.com, neither of which do, you could press bak on z.com to go to x.com, and back on x.com to go to y.com, and vice-versa with the forward button. The actual content of the applet would be irrelevant, unless it did something to affect the back/forward buttons. I dunno if Java can or not.

    A Java Script (not to be confused with a Javascript) doesn't even use a browser, so there'd be no back/forward buttons to be affected by.
Sign In or Register to comment.