Exit this Page Button
Step 1 - Download and customise the script
We have created scripts that you can apply to your subsites.
Download exit this page scripts (ZIP) [1KB]
These scripts are available in a ZIP file, which contains two JavaScript files: one for adding the exit button on a per-page basis, and one for applying it globally across all pages within the subsite. You can use either method depending on your needs.
Once downloaded, open the scripts and make any necessary adjustments.
Target URL
var qeTargetUrl = "https://www.bbc.co.uk/weather/2643743";
This variable defines the website to open in a new tab. It's currently set to BBC's weather in London, but you can change it to a more relevant website for your area.
Target replace URL
var qeTargetReplace = "https://www.google.com/search?q=bbc+weather+london&safe=strict&sca_esv=589766361&ei=xAV3ZZ-7G9OEhbIP8aCswA0&ved=0ahUKEwifrYOetoeDAxVTQkEAHXEQC9gQ4dUDCBA&oq=bbc+weather+fenland&gs_lp=Egxnd3Mtd2l6LXNlcnAiE2JiYyB3ZWF0aGVyIGZlbmxhbmRIAFAAWABwAHgBkAEAmAEAoAEAqgEAuAEMyAEA4gMEGAAgQQ&sclient=gws-wiz-serp";
This variable replaces the current page with a different URL. It's set to search for "BBC weather London" on Google.
Button styling
var qeStyles = ".cta-link--qe{line-height: 1.2;position: fixed; bottom: 20px; left: 5px; margin: 0; border: 2px solid #fff; z-index: 1;}.cta-link--qe::after{top:auto;}";
This variable applies styling to the button. Amend this to align with your branding and design.
Button label
qeHTML.title = "Immediately exit this page and cover your track";
This variable provides a descriptive title for the button, making it more accessible for assistive technologies. The main button text may be vague for security reasons, so the title helps explain its function.
Button text
qeHTML.innerHTML = "<span>Quick Exit</span>";
This variable changes the text that appears on the button. Make sure the text reflects the purpose of the button while considering clarity and security.