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


ADVERTISEMENT

JQuery :: For An Action On A Element, Stop The Action On His Parent?

Dec 2, 2009

Is that possible when you click a child that the function on the parent don't run.

In these example, if I click on 'h2 > a
', both elements triggers functions ('h2' & 'a')
What I wan't is that if I click on 'h2 > a

[code]....

View 1 Replies View Related

JQuery :: Stop A Action Hover And Just The Last Action Happen?

Jul 23, 2011

I need to know how stop a action hover and just the last action happen

View 2 Replies View Related

Changing The Action Of A Form With An Input Named Action?

Feb 16, 2009

I have come across a very interesting problem that seems to be impossible to solve. Basically a web application that I am working on relies on a JavaScript function called go to change the input named view to the page name and submit the form. This form's type is post, so no values are included in the actual URL string. There is also another input called action and it's value is view. This is to tell the application that the user would like to view a page. The problem is because of the variables being of method post, page refreshes and back and forwards return errors because the post variables view and action aren't sent with the required data. To somewhat solve this problem I have created a feature that tells the application that if the post value page is empty then to try and get a GET var called page. To insert this var into the go javascript function I simple add this code

document.go.action = document.go.action+"&page="+page;

This line basically adds &page=[page] to the action of the form. The problem is, this code doesn't work because action is also the name of a form element. Referencing document.go.action refers to the input element named action and not to the form's action. Changing the named of the action input value is out of the question (Way to much changing of code, and possible room for error). What can I do to change the action of the form without referencing the input named action. Here is my go form and the JavaScript code:

<form name="go" action"index.php?sid=123" method="post">
<input type="hidden" name="action" value="view" />
<input type="hidden" name="view" value="" />
</form>

[Code]....

View 6 Replies View Related

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

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 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

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

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

Form Without Action 'imitate' Of Other Form (which Do Have Action)?

Mar 5, 2008

I have a very weired problem (which is not easy to describe.. but I'll do my best):I have a html page with several forms , only one of the got the action="ComputeAndReturn" and the other forms got only name="" tag.the problem is that after i submit the form with the action , and than after a computatioon it returns to the original page, now... if i will submit any of the forms without the action=.they will act as if they were defined action="ComputeAndReturn" (altho they are not!)if they were defined from the first time with action="anything", and than i would submit the form with action="ComputeAndReturn" this problem would not appear (the other forms will keep their action="anything" and would not "imitate" the action= "Compute AndReturn" to them selfs...

any ideas how can i keep my forms without action="" , cause all i need them to do is be submitted to pass the submitted value to other form inside that page.[code]

View 8 Replies View Related

Form W/php Action

Jul 23, 2005

I have a form which needs posting the php script below. (I sent my vars to a
cookie, which I have read correctly). This is the form command used in
hoping to process my information.

<form method="POST" action="scripts/WebContractor.php" name="bizinfo"
id="bizinfo">

Since most of this is new to me, please let me ramble in my thought process.

1. post the vars to a cookie
2. post the form pointing to the php script
3. read the vars in the php script
4. send the info from within the script

When I submit my form, I receive a dialog box stating the downloading this
file can be dangerous. What happens is the php script is downloaded to my
desktop - not executed. Code:

View 3 Replies View Related

No Action In Submit?

Dec 16, 2011

I have created a form for file upload based on cgi script. In form action attribute, i have called cgi script.

<form name="content" id="content" action="../cgi-bin/upload.cgi?upload_id=" method="POST" enctype="multipart/form-data" onsubmit="setValueforHidden(this)" target="xupload">
when the user presses the submit button(after form valdiation was over ) i have called the below api.
function StartUpload(f1)
{
var UID= Math.round ( 10000 * Math.random () ) + '0' + Math.round ( 10000 * Math.random() );

[Code]...

View 1 Replies View Related

How To Check If Action Is Done

Jan 4, 2011

How can I verify if the action after my $.ajax call is done and if not perform until done?Sometimes it performs the action sometimes it doesn't, it loops the request in this case the action:

$('#osa_stocka_'+completo_count+'_'+d).html(rt);

Rest of the code.

var data='id='+$('#osa_stocka_'+completo_count+'_'+d).attr("title");
var dataString = 'status=checkopapstock&'+ data;
$.ajax({

[code]....

View 5 Replies View Related

How To Remember Last Action?

Nov 15, 2006

I am creating a navigation system for my site, all menues are hidden only their headings are appear on the site. When a visitor click on a heading its shows the navigation links. Its working smoothly.

The problem is when user open a navagation menu and click on a link to browse the next page/link, after loading the next page the menu got close and visitor need to reopen the desired menu. I want that the desired menu stay open while browsing the site and only closed when a visitor wants to close it. Code:

View 6 Replies View Related







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