OK I am using ajax to load different pages. But once one page is navigated away from I want to run a function. How would I do this without the body tag??
Thanks.
Thanks.
| Dougie1 wrote: |
| OK I am using ajax to load different pages. But once one page is navigated away from I want to run a function. How would I do this without the body tag??
Thanks. |
| Code: |
| window.addEventListener('unload', unload_func, false); |
| blueray wrote: | ||
Please try this.
|
| Code: |
| if(window.addEventListener)
window.addEventListener('unload', unload_func, false); if(window.attachEvent) window.attachEvent('onunload', unload_func); |
| Dougie1 wrote: |
| But once one page is navigated away from I want to run a function. How would I do this without the body tag?? |