• I am helping prepare a domestic violence website which needs a quick-escape button which would clear the current page and also prevent the back button from returning to our site. Using this JavaScript code works fine on my non-Wordpress personal website. Obviously it won’t work in WordPress.com because the JavaScript would be stripped out. However I had hoped that in WordPress.org we could get it to work. Any ideas?

    ANGLEBRACKET a href=”javascript: location.replace(‘http://google.com’);” title=”To immediately leave this site and redirect to an unrelated site (Google), click Quick Escape. Test this feature RIGHT NOW to ensure that it works properly and that you are familiar with its function.” CLOSEANGLEBRACKET Quick Escape ANGLEBRACKET /a CLOSEANGLEBRACKET

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi, I use a plugin called Hana Code Insert, which lets you define blocks of code (HTML, PHP, and Javascript) and then insert them in to your pages, posts or widgets using tags. It works great.
    http://wordpress.org/extend/plugins/hana-code-insert/

    DH, thanks, looks very useful, will try this out asap. I did succeed in getting that clear-the-back-button code to work on its own, but still very glad to know about the HanaCode. –ER

    Thread Starter eridout

    (@eridout)

    Actually, that JavaScript clear-the-Back-button code does not work as well as it first seemed.

    The requirement of this Back button code is (1) to switch from the domestic violence site to an “innocent” site, like Google, and (2) to prevent a subsequent press of the Back button from returning to the domestic violence site.

    Requirement 2 is only met if only one page of the domestic violence site has been shown. In all cases, the Back button returns to the last-but-one page, so if multiple pages have been shown, the domestic violence site is displayed again.

    Anyone have any ideas?

    I would also be interested in this as I am also setting up a site for a domestic violence organisation.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘clearing the back button – how to do it?’ is closed to new replies.