Solved

Upon site exit, open new window for questionaire

Posted on 1998-05-15
3
223 Views
Last Modified: 2006-11-17
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
0
Comment
Question by:kpaulk
  • 2
3 Comments
 
LVL 5

Accepted Solution

by:
Trevor013097 earned 80 total points
ID: 1278152
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
 

Author Comment

by:kpaulk
ID: 1278153
Thanks Trevor.  I got this to work...but I would like to see if there are any other variables that might work.

kpaulk
0
 
LVL 5

Expert Comment

by:Trevor013097
ID: 1278154
kpaulk,

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

Trevor.


0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question