Events Tab - XSitePro Website Design

Home Previous  Next

icon_xsp

Brought to you by XSitePro Website Design Software

professional website design made easy      

 

OnLoad and OnUnload Events are powerful functions that allow us to trigger scripts to be run on the event of a page loading (OnLoad Event), or when a user attempts to leave a Web page (OnUnload Event).

 

Care must be taken when using these events in that they can often not have the desired effect. Specifically you must remember that OnUnload Events are not site exit events. They are page-specific.

 

For example, if a visitor on your site is trying to navigate from the current page, ‘Page A’ on your site to another page, ‘Page B’ on your site, this will in fact constitute an OnUnload Event for ‘Page A’ and so any associated script would have been fired.

 

Imagine how annoying it would be if the script that fired was a “Please don’t go...” Pop-up script, or similar. It would be incredibly annoying to say the least.

 

Bearing this in mind, let’s take a look at the settings in this tab.

 

 

Instructions

 

To load this tab, within the Advanced Page Settings window, click the “Events” tab.

 

piece_advanced_page_settings_tab5

 

 

We have two Events we can activate, and for which we can insert our script(s):

 

 

Use OnLoad Event – Checking the ‘Use OnLoad Event’ checkbox activates the OnLoad Event for this particular Web page. Whatever we then specify as the script, associated with this event (see below), it will be triggered when the current Web page loads. Every time it loads.

 

To set a script for this Event, click the button_advanced_page_settings_edit button. This will load a text editor window into which you may simply paste your script code.

 

Note: This script code will be code you have found and checked out yourself – it is not supplied as part of XSitePro. There are plenty of free script sites offering thousands of scripts online, and which give detailed instructions on their use.

 

Once you have pasted your script code into the text editor window, click the button_advanced_page_settings_ok button to save the code and return to the Events tab, in the advanced settings window.

 

 

Use OnUnload Event – Checking the ‘Use OnUnload Event’ checkbox activates the OnUnload Event for this particular Web page. Whatever we then specify as the script, associated with this event (see below) it will be triggered when a visitor attempts to ‘unload’ this page (i.e. navigate away from this page), even if they are remaining on your site.

 

To set a script for this Event, click the button_advanced_page_settings_edit button. This will load the text editor window into which you can simply paste your script code.

 

Once you have pasted your script code into the text editor window, click the button_advanced_page_settings_ok button to save the code and return to the Events tab, in the advanced settings window.

 

 

If you do not wish to make any changes on any of the other advanced page settings tabs, for this page, you should click the button_advanced_page_settings_ok button to save your changes and return to the Page Settings screen in XSitePro.

 

Note: Until you click this button (even if you navigate to other tabs in the advanced settings window) your changes will not have been committed.

Home  Previous  Next