Page 1 of 1

Leave Page BBCode

Posted: 05 Mar 2010, 11:13
by BBCode Bot
Leave Page BBCode

Author: Stoker
Description: With the Leave Page BBCode your users will get a deny/confirm popup asking them if they want to leave the page.
Works in Firefox, Internet Explorer, Google Chrome
Not Opera or other systems where javascript is disabled.
[valid][/valid]

BBCode:

Code: Select all

[leave]{SIMPLETEXT}[/leave]
HTML:

Code: Select all

<script type="text/javascript">
window.onbeforeunload = askConfirm;
function askConfirm(){
        return "{SIMPLETEXT}";
        }
</script>
Helpline:

Code: Select all

Leave page: [leave]Simple text[/leave]
Example:

Code: Select all

[leave]Thanks for visiting. Have a nice day[/leave]
Demo:
[leave]Thanks for visiting. Have a nice day[/leave]