Solved

Upon site exit, open new window for questionaire

Posted on 1998-05-15
3
226 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
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…
Suggested Courses

624 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