Angel
04-30-2000, 06:02 AM
hello, I need a script that does the following:
opens a window upon exit but only if the user does not click a button that leads them to the same place...
can such a thing be done? and where can i find it.
thanks
Owen_MC_Evans
04-30-2000, 12:15 PM
This can be done with the following JavaScript
<BLOCKQUOTE><font size="1" face="Verdana, Arial">code:</font><HR><pre>
<Script language="JavaScript">
<!--
function openWin(loc,win){
set done = document.donef.done.value;
if done <> "true" {
window.open(loc,win)
done = "true"
}
// ->
</SCRIPT>
[/code]
now then some where you will have to insert the following which cantains a variable set when the document carries out the window opening the code is as follows
<BLOCKQUOTE><font size="1" face="Verdana, Arial">code:</font><HR><pre>
<Form name = "donef">
<input type="hidden" name = "done" value="false">
</FORM>
[/code]
then you have to set up the code for the linking button
within the button code insert the following
<BLOCKQUOTE><font size="1" face="Verdana, Arial">code:</font><HR><pre>
onclick="openWin("The_Location_of_The_Page.htm","")";
[/code]
and now you need to add the following in the body satement
<BLOCKQUOTE><font size="1" face="Verdana, Arial">code:</font><HR><pre>
onUnload="openWin("The_Location_of_The_Page.htm","")";
[/code]
this should work!
Owen
[This message has been edited by Owen_MC_Evans (edited 04-30-2000).]
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.