Remember The Time When User Closes The Window?

Feb 17, 2011

I need to remember the time when user closes the window and later when he/she comes back, site will highlight latest news that happened when user was offline. So far the best solution I have found is jquery.unload (since I use jquery): it sends some data to php script (which remembers the time) via ajax when unload event triggers, so is it the best way to solve this problem?

View 1 Replies


ADVERTISEMENT

How To Detect That User Closes The User-agent Window ?

Dec 2, 2005

I have read all posts about how to detect that url have changed to new
page and trigger the event handler then eg.

function aidLogout(evt) {
if(evt) {
/* maybe via analyse of evt object i can detect the close of the
browser window */
}
if(window.event) {
/* maybe via analyse of window.event object i can detect the close of
the browser window */
}
var i = new Image();
i.src = "aidlogout.asp?uid=1562&SessionID=ABCDEFGHIJKLMNOP"
} /* assuming that aidlogout.asp will return nothing or empty image */

window.unload = aidLogout;
/* or via
if(window.addEventListener) {
window.addEventListener("unload", aidLogout, false);
} else
if(window.attachEvent) {
window.attachEvent("unload", aidLogout);
}

PS i know about super Gecko onclose event which fires when browser
window is closed, but i could not find such method in IE.

View 8 Replies View Related

Detect When User Closes Window?

Aug 14, 2009

How do i detect when a user closes my window?

View 4 Replies View Related

Trying To Run Some JS Code Once User Closes Window / Tab

Apr 9, 2010

I am looking to write some code that, once the window is closed, it runs some extra JS which loads a *.php file through an AJAX call. In theory to me it sounds simple but for some reason I cannot get it working. I tried the "onload" attribute but then found that triggers with refresh and links (not good). I simply need the JS code to start running some other JS when the window closes.

Code:
<script type="text/javascript">
function doUnload() {
$.post("");
}
</script>

View 2 Replies View Related

Open A Popup After A User Closes Browser Window?

Nov 25, 2005

I need to create an application that will open a popup when the user closes a window. I can do that easily via onUnload event of javascript but the catch is that the popup must open only when we close the window and not when we submit a form or click a link on the page.Actually it is a survey which opens only when one closes the window.

View 4 Replies View Related

Div Tag That Show Unless The User Closes It?

Apr 24, 2011

I was at cracked when I saw this (take a look at the bottom):[URL]... You'll see that there is div tag fixed to the bottom of the screen (when you scroll, it's still there). The only way to remove it is by pressing X. Now I presume this button will always show for as long as the user is on the site, until he presses the x. After that, he'll never see the div again. Am I right in this assumption?

Whether yes or no, I'm still curious as to how cracked accomplished making that. Can somebody provide an extensive answer as to how I can do what cracked did?[URL]...

View 4 Replies View Related

Call Function When User Closes Browser

Mar 17, 2006

I need to call a javascript function when the user closes the browser window. I have tried onunload but that runs when the user clicks a new link as well. I need something that only runs when the browser window is closed.

View 1 Replies View Related

Form Opening In The Main Window/ Simeltaneiously Closes Popup Window

Jan 8, 2004

I have a popup window which has the search form in. What I want to do is for the popup window to close once the form is submitted, and to post the form data to a page on the main window.

Is anyone able to advise. As the main page is dynamic, it is not possible to give the page a name.

View 4 Replies View Related

Trigger Action In Parent Window When Child Window Closes?

Jun 25, 2009

Put a link on my page that will open an external site (over which I have no control) in a pop-up window. When the user closes the pop-up, I want my original page to redirect to another page. The difficulty I'm having is that I can't add any code to the page in the pop-up as it's not my site.

View 4 Replies View Related

Cookies To Remember User

Oct 22, 2009

I would like to implement a cookie feature on my site that when a user logs in a cookie is stored for him and the next time he comes back, he doesn't have to sign in. I have researched hotscripts and javascripts but the ones I have found have to do with the "remember me" and thats not quite what I want. I tried to manipulate it but with no luck.

View 2 Replies View Related

Close Child Window When Parent Window Closes?

May 3, 2009

I'm trying to create code to close the child window I'm creating if the parent window is closed. Here's my code so far:

function openWindow() {
var newWin = window.open(); // open the new window
newWin.document.write('<h1>Child Window</h1>

[Code]...

The above openWindow function is used in this event: <input type="button" name="btn" onclick="openWindow()"value="Open a new window" />

I can generate the new window fine. I just can't close it if the parent window is closed.

View 1 Replies View Related

Setting Cookies To Remember What User Selected

Nov 20, 2011

I'm setting up a fictitious shopping page which uses cookies to remember what a user has selected. The products are photographs that the user can select either framed or unframed versions and I'm trying to put a confirmation box if the user actually requests framed and unframed versions of the same photograph. The code I'm using actually worked before I tried to add this extra functionality but I can't work out how to test for this extra bit. Here's my code and it sets cookies with names as either lulworth01 for the unframed version or lulworth01f for the framed version. The bits that work are in black and my extra code for this test is in red.

function getCookie(name){
var index = cart.indexOf(name + "=");
if(index == -1)
return null;
index = cart.indexOf("=", index) +1;
var endstr = cart.indexOf(";",index);
if (endstr == -1) endstr = cart.length;
return unescape(cart.substring(index, endstr));
} function setCookie(name) {
if ((name.charAt(name.length-1)='f') && (getCookie(name.substring(0,10))!=null)) {
confirm("You seem to have placed orders for both a mounted and framed image of the same photograph.
Is that OK?");
} else {
alert("Thank you.
Your basket has been updated.");
x=parseInt(getCookie(name)) || 0;
y=x+1;
var today = new Date();
var expiry = new Date(today.getTime()+28*24*60*60*1000); // plus 28 days
document.cookie=name+"="+y+";expires="+expiry.toGMTString();
cart = document.cookie;
}}

View 3 Replies View Related

Run Function When Window Closes?

Oct 30, 2010

I'm developing a chat module for our cms. Its working mostly, but I need to make it so that in some situations when someone closes a window that it does a xmlhttprequest to mark the session as closed.Some lite reading seems tell me there is no onclose event, but there is an unload event. Further reading leads me to believe that the unload event may not work when a window is closed.

View 2 Replies View Related

How To Keep Child Window Open When Parent Closes?

Jul 23, 2005

I have a closed box system which opens an html page. The page closes by the
system. I have access to the html page. I added code to open a child window
from this page. However when the parent window closes, the child closes
too. Is there a way to keep the child window open? Yes keep it orphaned.

View 2 Replies View Related

Popup Closes Main Window Problem

Jul 20, 2005

I have a simple page on my freebie account site that opens a popup
window running index.asp on another site of mine. The code on the
freebie hosted server is below. What I'd like to do is have the
freebie hosted page shut down once it's opened up the child window.

View 1 Replies View Related

Refreshing The Parent Window When A Popup Closes Using Javascript??

Oct 13, 2003

i have a popup from the parent window which allwos the user to add in new location. when the lcoation has been added succesfully. then thewindow closes and the parent gets refreshed. In particular, just the location listbox gets updated with the new value. the location listbox i generated from the database using asp.

View 2 Replies View Related

Top.close Closes The Window Before Responding To Alert In Child Frame

Dec 20, 2005

I am encountering a problem where I have a window and there are three
frames, one in the left, right and in the bottom. The bottom most frame has
common submit buttons. There are several tabs in left frame. Each one loads
a different form on the right frame. After fetching the contents of the form
from user, I am validating the text fields in the form using onChange() event
handler. After entering the text value in the textbox, if I press Submit
directly, the "Submit" as well as the validation routine happens concurrently.
Only at the end of validation, the field is marked as dirty. Now, if field is not
marked dirty, the Submit function will close the window without actually
submitting as nothing was changed. So when an invalid value is entered and
the Submit is pressed directly, an alert pops up temporarily but the close()
call from the parent frame immediately closes the alert window before user
can respond. This problem does not occur in IE as in IE, unless the alert
window is responded, the close() call cannot close the alert window. Code:

View 7 Replies View Related

JQuery :: Login Window - Click In A Field Inside The Login_box Div The Div Closes?

Feb 26, 2010

i have som trouble creating a login form which should only display on click.I have an image button with an a href and according class "setvisible" to make a div called "login_box" visible on click.The following should be possible:

-> Click on "Login"

-> Form opens

-> Click on "Login" again should close the form

-> Click outsithe the "login_box" div should close the form also

I've managed to get it working so far but my problem is that everytime you click in a field inside the login_box div the div closes.. I know thats because of the ('document').mouseup function but i don't know how to do it the right way.I know i could do this with "toggle" but i'd like to have fadeIn / fadeOut effect instead of just"show" and "hide"..here you can see a live working sample (click the blue login button):[url].....

View 4 Replies View Related

Check The User Enter Time With Current System Time

Mar 2, 2011

I am trying to check the user enter time with current system. If user enter the time less than the current system time then I want to display the alert box. But the code is not working. Here is the code

<html>
<head>
<title>test</title>
<script type="text/javascript">
var d = new Date();
var curr_hour = d.getHours();
var curr_min = d.getMinutes();
[Code].....

View 11 Replies View Related

Using Javascript To Disable The Remember Username And Password Window

Oct 11, 2006

Most of the browsers has a feature that prompts the user to save the username or password when filling a form.

I just want to disable this feature. Can i disable this feature using Javascript?

Because there are some users that will not read on the message or information on the pop window that prompts them to save the username and password. I know it can be disabled manually through the browser's preferences.

Is it possible to disable it using javascript?

View 2 Replies View Related

JQuery :: Can't Remember A Window On Website That Expands With Option To Close It?

Jan 9, 2012

You know when you go to a website, and you see a window that expands with content in it. It also gives you the option to close it. What do you call this window? I forgot, but told myself I would go back and learn it.

View 3 Replies View Related

Getting Time From Website Vs User?

Jul 6, 2010

You know how the get time functions pulls info from the users computer? Is there a way i can get that same information from a web site or a clock on the the same web site?

View 1 Replies View Related

Get Time That Does Not Rely On User's Clock?

Aug 15, 2009

I want to make a switch statement that will display something different depending on the time of day. Once I saw something like getTime (?), but it relied on the user's clock. I know that you would expect me to at least research getTime so that I'm asking about something more specific, but I don't think it's what I need because I want mine to give the same result regardless of the viewer's time zone or how off thier clock is.

View 8 Replies View Related

Can Javascript Do Something At Submit() Time To Distract The User?

Jul 23, 2005

Can javascript do something at submit() time to distract the user?... like clear the form... or clear the screen ??

I have seen some fancy ways to prevent multiple clicks..... but a number of my cgi's eat up several seconds before they can respond and I would like to keep my user out of trouble.

Whatever it is. it has to be non-modal and not involve nph headers (my webserver does not support them).

View 2 Replies View Related

Does Object Gets Date From User Local Time?

Oct 23, 2010

I was wondering if it is true that the Date object gets its date from the user's local time, if so, could the user "hack" the time by adjusting his local time?

View 6 Replies View Related

If A Check Box Is Or Not Empty - Allow User To Have One Box Checked At Any Time In A Form

Mar 31, 2009

I'm trying to figure out with Java Script how I would have Java Script check and see if a check box is or not empty. The goal is to only allow the user to have one box checked at any time in a form. That means, if they click on another one and there is already one checked, it would uncheck the one that was checked and make the one that the person checked on next checked.

View 4 Replies View Related







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