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.
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.
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?
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'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...
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?
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?
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.
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.
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?
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.
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:
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
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]...
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.
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?
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.
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?
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.)
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.
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.