PDA

View Full Version : Need a Javascript Guru!



Erin Salmon
01-06-2004, 02:06 PM
Hi all,

I'm developing a live chat application in ASP for my own website. At present it all works nicely - users click a link which sends a request to my computer to open a chat channel for them. If my app is running then a chat channel is opened, if not, they are apologised to profusely.

Once the chat channel is opened we can talk fine - new users will initiate a separate chat channel.

Here's the javascript bit:

I have a page called "logoff.asp" which is supposed to clear the application variables (oh boy, that's important!). I can invoke the page by having a user click on "exit" from the chat window, but if the user exits by clicking the cross at the top right of the window the page isn't called! BAD!

I am trying to use onUnload="window.open('logoff.asp')", but it doesn't work!

I thought the point of onUnload was to catch users clicking on the cross?

Perhaps the problem is that my onUnload is in the wrong place. I gather you can use it in a FRAMESET, which is where I have it. The chat window has two frames. Default.asp has two frames; display.asp, and message.asp. The "exit" link is in message.asp, and works fine for invoking logoff.asp, but onUnload in the FRAMESET in default.asp doesn't work.

Where am I going wrong?

Cheers!

Erin