![]() |
|
|
+ Search |
![]()
|
Nov 22nd, 2008 17:48
haytham ali, ha mo, Manu G, Colin Fraser, Daniel Amsler, http://msryat.org
Sure, why not!
Use the onunload event of the body tag.
Something like this:
<body OnUnload="alert('Woo hoo..');">
This will be called everytime the backbutton is pressed.. woo hoo.. :)
but one care needs to be taken.
This will also be called when any link or button on the screen are
clicked. So be sure to apply some kinda check on the buttons/ links.
Something like:
<body onload="flag=true" onUnload="if (flag) alert ('Woo hooo..');">
.
.
<input type=button onclick="flag=false">
This validation will make sure that on the button click, that logic in
the onunload thing is not called...
All the best & keep rockin'
~MeTaL~
http://6rb.com
http://fr7.com
http://dir.msryat.org
http://6ef.com
http://forums.msryat.org
http://www.arabcar.com
http://www.alshalah.com
http://msryat.org