Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Upon site exit, open new window for questionaire

Posted on 1998-05-15
3
Medium Priority
?
228 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 320 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This article discusses how to implement server side field validation and display customized error messages to the client.
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…

730 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