Upon site exit, open new window for questionaire

Initially, I have a splash screen load from our root url (www.mydomain.com/index.shtml) which in turn does a browser sniff and displays frames.html in a new window, which is resized according to the resolution of the surfer's monitor settings.  Frames.html displays only the page but doesn't display a menubar, button bar, address bar or a links bar (MSIE and N4).  Frames.html consists of header.html and footer.html.  Between the two is a nested set of frames that display salesmenu.html and saleshome.html.  The frames are tagged top, middle, and bottom.  When a user leaves my site, I want a questionaire to popup logout.html (I know that this irritates some, hence my later creation of a cookie that will only do this once)for them to either fill out or which they can close.  I have little experience with java so please be descriptive.  This is what I have been using.

<script language="Javascript">
<!--
var doit=true;
function exitcnsl()
{
if (doit)
open("http://www.mydomain.com");

}
//-->
</script>  


in my links I have the statement as false.


<a href="products1.html" target="middle" onclick="doit=false"> <img src="../buttons/products1.gif"
alt="prody.gif (1550 bytes)" style="color: rgb(255,255,255)" WIDTH="157" HEIGHT="24">

Can someone please explain this in great detail?

Thank you in advance
kpaulkAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Trevor013097Commented:
kpaulk,

What I think you want is a window which will open when someone leaves your website.

To do this you would simply call your new window function from an onUnload which is placed in your BODY tag like this:

<BODY onUnload="myexit();">


Then in your script tag put something like this:

<SCRIPT LANGUAGE="Javascript">
<!--

function myexit() {
var newWindow;
winOpts='toolbar=no,location=no,directories=no,status=no,scrollbars=no,menubar=no,width=200,height=200';

      Urlvar = "UrlforQuestionnaire.htm";
      Questionnaire = window.open(Urlvar,'newWindow',winOpts);
}
//-->
</SCRIPT>

What I have done is split the usual window open code into more managable sections.  It set sets the URL to be loaded in one variable and the options for the window (such as toolbar on/off etc) in other variable and then opens the window pulling all the variables together.

Hope this works.  If you need any help then please ask.

Trevor.


0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
kpaulkAuthor Commented:
Thanks Trevor.  I got this to work...but I would like to see if there are any other variables that might work.

kpaulk
0
Trevor013097Commented:
kpaulk,

What do you mean by other variables.  Do you mean another method or changing the popup window?

Trevor.


0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.