PDA

View Full Version : Switch Content Script II Interferes With Exit Pop-Up



markfarrar
05-08-2011, 09:59 PM
I am using the Switch Content Script II script on a couple of pages on our site, and it works fine.

However, we also use an exit pop-up script across the site, and I've just noticed that on the two pages where we're using the Switch Content Script II script, the exit pop-up is not being triggered.

The exit pop-up script should be triggered by this code, which appears just before the end of the HEAD section of the pages:


window.onbeforeunload = ExitPop;

Except it's not being triggered on the two pages with the Switch Content Script.

I thought it might be this line, in switchcontent.js, that was causing the exit pop-up to fail, so I took it out (as I don't care about persistence), but that didn't work either:


switchcontent.dotask(window, function(){instanceOf.rememberpluscleanup()}, "unload") //Call persistence method onunload


So, anybody got any ideas how to make sure our exit pop-up still gets triggered, even on the pages using the Switch Content Script?

Thanks.