Onunload And Redirect

Jul 23, 2005

I am trying to use the onunload event to know when the user closes a
popup by receiving a request on the web server.

I have a main page from where the user opens a popup. What I want is
when the user closes the popup, it sends a request to my web server
(GoAhead) using the onunload event, then closes the popup.

For the moment, this what i have: when the user closes the popup, I
use the onunload event to open a different popup (by this way, I get a
request on the web server and I know that the user closes the first
popup), then, this new popup closes itself with the onload event. It
is working but having this second popup opening and closing is not
very neat.

If I try to change the location of the first popup in the onunload
event: onunload="document.location='....'", it doesn't send a request
to the web server when the user closes the popup.

Is there a way to send a request to the webserver when the user closes
the popup without the need to have an extra popup opened and closed ?

The web server I am using is working on a pseudo "cgi" mode called
"goforms", it avoids to create a different process for each request.
With "goforms", each request is handled by a unique process which is
always running.

View 3 Replies


ADVERTISEMENT

IE And Onunload

Aug 10, 2007

I'm trying to implement an exit pop up message when a visitor leaves the site. I'm using the "onunload" event handler. In FF, it works fine. The message appears. But in IE, the pop up only appears when I do a hard (shift+refresh) refresh.

Any ideas why IE is acting differently?

View 2 Replies View Related

Redirect Any Link Clicked + Redirect On Page Views

Jun 6, 2009

Im looking for a simple code to redirect to a specific URL on any click on page and redirect to certain url after a certain number of page views.

View 18 Replies View Related

Onunload Action

Jul 23, 2005

I have an onunload event in the body tag. When it is activated I want to
know if a <a></a> href was clicked and which one. Is there some document
property or any other object available for such a thing?

View 5 Replies View Related

Confirm Msg On OnUnload?

Jul 23, 2005


Is there anyway to display a confirm msg onUnload of a page?

I mean to say if iam calling onUnload=javascript:check();

and in check(){

if(confirm("check?"))
{
unload the page;
}
else
{
Dont unload , just come back to the previous state( i have some
values in text fields to be retained)
}
}

I want to call this function on Unload.

View 3 Replies View Related

Onunload Not Firing?

Jun 7, 2006

I'm using IE6 and I've just created a simple page with this event:
<body onunload="alert('sad')">

could someone tell me if this works for you if you have IE 6? I've
tested this in firefox and IE 7 and they both work fine with it. but on
the IE6 copy I'm testing, the event is fired only when the page is
refreshed. It's not fired when I close the page...

View 1 Replies View Related

Problem With OnUnload

May 13, 2003

I was trying to combine PHP & JavaScript to acheive on task:

I was trying to use javascript function to perform an PHP code, but the onUnLoad function seems to perform that query when the visitors reloads the page?

I want the PHP code to execute when the user EXITS the page.

javacript code....

<body onunLoad="doExit();">

Can anyone give me a function name or how can I make that work with onUnLoad?

View 2 Replies View Related

Redirect Two Pages Back (not A Button A Redirect)?

Oct 7, 2009

javascript:history.go(-2) makes it go two pages back for links but how do u put it in the script tags just when the page loads go back 2 pages?

View 1 Replies View Related

Onunload Without Body Tag Reference?

Jul 20, 2005

I'm working on an asp.net site and am trying to implement a popup help
window. I want the window to close when the user advances to the next page
in our application. The thing is, I'm doing this on a component basis and I
don't have access to the body tag from within my help component, so I can't
add the onunload tag. Is there some other way of achieving what I want? Can
I add an eventhandler to the body tag through javascript?

View 2 Replies View Related

Onload Without Onunload Being Executed...

Jul 20, 2005

I would like to ignore onUnload action when the user reloads the page!!

View 6 Replies View Related

Body Onunload For External Links Only

Jul 23, 2005

does anyone have sample code to display a pop up when a user leaves the
site? I really don't want to use this technique, but the clients
demand it.

I'm thinking something like un body onunload, catch the URL they're
linking to and parse it for our own site's url and only display the pop
up if they're different.

View 10 Replies View Related

Detecting If OnUnload() Was Called Because Of A Refresh...

Sep 2, 2005

Is there a way to detect if the reason an onUnload()
handler was called originated from the user explicitly
refreshed the page(s)?

Ie. pressed "Ctrl-R", "F5" or klicked the refresh button
in the toolbar or the context menu?

I'm aware that I can not stop a refresh, but the reason
I want to know is that I have a hidden frame in an intranet
application. This hidden frame is present at all times after
the user have sucessfully logged in (to our db).

So the only time this frame is closed is when the user
navigates away from the intranet app. At which point I want
to log him/her out.

I do thid With an AJAX call in the unload-event of the hidden
frame.

*BUT*... This leads to logging out if the user presses "F5",
or in other ways refresh the window, since a refresh reloads
both frames.

So I thought that if I could detect that this was a refresh in
progress, I can avoid logging him/her out.

View 3 Replies View Related

Admin Logout & Body Onunload Event

Jul 23, 2005

To make my system's admin page safer maybe I should apply
<body onunload=""> somehow so that admin session would be reseted
immediately after user closes the window?

But how to check easily that unloading refers only to
windowclosing, not to following links to other admin subpages?

View 1 Replies View Related

Strange Thing Happening With Onunload And Google

Jul 23, 2005

I have set up a disclaimer page for our public access PCs at our Libraries which has the following function:

function breach() {
alert("Proceeding beyond these Conditions is..................... If you have read the Conditions, scroll to the bottom and press the 'Yes I

agree' button.")
window.location="disclaim.htm"

and then in the body tag I have onunload=breach()
This works fine for all websites entered into the address bar except if

you enter www.google.com

What it is supposed to do is bring up the prompt and when you click on the OK button it will go back to the disclaimer page. They should only be able to get to the web by clicking on the 'Yes I
agree' button at the bottom of the disclaimer page. Does anyone out there know why google doesn't fire up the disclaim.htm page like all the other sites? It is very frustrating.

View 1 Replies View Related

Permission Denied To Set Property Window.onunload

Jul 20, 2005

This error occurs ONLY in Netscape 7.0. Not in 7.1. So, I think it's a
bug. Buuuut...

Has anyone had this problem or know of a fix?

When attempting to have an onunload function set with "window.onload=",
the error comes up
"permission denied to set property window.onunload"

I can't find a thing on this one. Setting it with the normal "<body
onunload" works fine. But isn't a great thing for me to do, since the
onload is part of a very large menu script.

Here's a test page to illustrate the problem. Netscape 7.0 has a problem
with this. 7.1 does not. IE is fine, too. Code:

View 6 Replies View Related

Getting The Body Tag And Appending The OnUnload Event Programmatically

Oct 15, 2009

I have a site with 5000 pages.

I need to add the onbeforeunload event to the body tag of each form. How can i do this programatically using javascript.

i would like to loop through the form, find the body tag append the onbeforeunload event.

(also, i would like to all href's) on each page.

this is what i have so far but it does not bring the body tag or hrefs's

<code>
function GetElementsFromForm()
{
//document.formOne.elementOne
//document.forms[0].elements[0]

[Code]....

View 1 Replies View Related

Windows7 RTM IE8 In Onunload Event - Reset The Cookies

Oct 13, 2009

In windows7 RTM IE8 facing problem in onunload event. In onunload event I am trying to reset the cookies,also I am trying to end the session at the server side.For this I am submitting a form on onunload.Its working in all the other browsers. But in windows7 RTM IE8 I am getting ACCESS DENIED java script error.Someone have encountered the same problem

View 2 Replies View Related

Redirect Won't Redirect And Doesn't Load Anything

Apr 19, 2010

I have a javascript that I found for an iphone style menu. It works and allows me to click through the menu as long as it is within the list system. If I try to create an external link to a webpage. It doesn't load anything. Here is the code let me know if anyone knows the trick so I can link out. Below is the javascript used to create the flowing menu system. Let me know if you need the rest of the .css and html.

(function() {
var animateX = -20;
var animateInterval = 24;
var currentPage = null;
var currentDialog = null;
var currentWidth = 0;
var currentHash = location.hash;
var hashPrefix = "#_";
var pageHistory = [];
[Code]...

View 1 Replies View Related

JQuery :: SlideUp() Function Doesn't Work At Onunload Event

Jun 11, 2010

I have some problem with onunload where I want slideUp my menu when I go out form site. I have the slideDown function fire at body onload and this function work properly. but the slideUp() at onunload not.

My code:
$(window).unload(function() {
$('#menuContent1').slideUp();
alert('Handler for .unload() called.');
});

and even the alert work. Only the jQuery slideUp not working.

View 1 Replies View Related

Body Onunload Event - Initiate Fancybox Popup On Page Unload

Feb 17, 2011

I am trying to initiate fancybox popup on page unload (i.e. when the user closes the browser window). I managed to find the following script which does the opposite (launches when the page loads). How can I reverse this code so that it executes on body unload?

[Code]....

View 5 Replies View Related

Body OnUnload="window.open()" Loop?

Mar 25, 2010

How do I pass incremented variables from the parent to the child if I use onUnload="window.open()" ? I tried window.opener.document.getElementById('targetname') but it doesn't work because the parent is already closed when the child tries to get the information.

View 3 Replies View Related

Redirect?

Jul 15, 2002

Perhaps this is a silly question (if so I apologise in advance), but I'm a low-level paper-shifter/part-time Web designer in UK Government and I've designed our Company's site.

Problem is like most Government Depts. trying to do anything involves much liasing with other Depts and much paper-shifting.

We have no Servers or Hosting capability ourselves so this part of the site is handled by (guess what?) another Government dept.

Many months ago I asked them to put a redirect on a number of older URLS for our site which were still being linked to by a large number of other sites.

I was reliably informed this had been done and checked the URLS and all seemed okay.

However I have just recently done a search for our site on AltaVista and the top hit is a subdirectory of the old URL with no re-direct seemingly in existence.

Question is if you put a redirect on a particular URL will it/should it always also include the subdirectories within that URL?

View 4 Replies View Related

Redirect WEB PAGE . . .

May 18, 2006

I hava a snippet below. This code will
redirect my current web page to http://www.xyz.com . . .
But I want to specify the number of seconds before it is redirected.
May I know how to do this? (As much as possible, meta tags should not
be used.)

<SCRIPT LANGUAGE="JavaScript">
<!--
window.location="http://www.test123test1111.com";
// -->
</script>

View 8 Replies View Related

Redirect After Download

Sep 13, 2006

My objective is to redirect to another web page after download is
complete.

I have an activeX called to download a few dlls using the following
code

document.writeln(' <OBJECT ID="MQC" ');
document.writeln(' CLASSID="CLSID:98c53984-8bf8-4d11-9b1c-c324fca9ca"
');
document.writeln(' CODEBASE="test.ocx#Version=9,1,0,4359"');
document.writeln(' WIDTH=100% ');
document.writeln(' HEIGHT=100% >');
document.writeln(' <PARAM NAME="DomainPassword" value=""');
document.writeln(' <PARAM NAME="RootURL" value="' + getTdRootURL()
+'"');
document.writeln(' </OBJECT>');

I tried redirecting in the onLoad event of the form but doesn't work. I
suppose it redirects as soon as the activeX is loaded and not when it
has finished its download.

View 1 Replies View Related

Redirect Using A J Script

Nov 28, 2006

I would like to redirect say from http://mysite.co.uk to
http://www.mysite.co.uk but because my home page is html I have to use JS

View 5 Replies View Related

Redirect To New Page ?

Mar 30, 2010

I have a form in which i have a dropdown list and a submit button. I want to code so that when users select the value from the dropdown list, it should redirect then to the specified page. For instance i have the value, "car", "House" and "pets" in my dropdown listbox, if a use click on "car" it should redirect them to the car page. I have done the following code, but something seems not to work :(

And in the submit button am calling the function move()

My form name is sell and the dropdown list menu is cat.

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved