![]() | ![]() |
| The code for an exit console: (note - you can highlight the code and press ctrl+c to copy it) |
|
The code for an exit console is exactly like that of a basic console, we just add some snipplets to make the console only pop when the page is exited. The extra code is highlighted in red. <script language="JavaScript"> You will need to place the following code into your <body> tag like so: <body onUnload="exitcon()"> On any links on your page that you don't want the exit console to pop (if the surfer clicks the link and as a result exits your page for a new location) place the following piece of code into your link. onClick="exit=false" example: <a href="http://www.google.com" onClick="exit=false"> |
| Breaking down the various parts of the code: |
|
Here, the attributes you can change remain exactly the same as the ones you can set with a basic console. Please refer to this section under basic consoles by clicking here.
|
| Where to place the code: |
|
You'll need to place this script anywhere between your <head> </head> tags. Don't forget to place the 2nd snipplet of code mentioned above into your <body> tag. Finally, don't forget to add onClick="exit=false" statements to the links you don't want to trigger your exit.
|
| A working demonstration of a basic console: |
|
Example of an exit console.
|