Top.Mail.Ru
? ?
Javascript's Journal
 
[Most Recent Entries] [Calendar View] [Friends View]

Monday, July 3rd, 2006

Time Event
10:11a
onBlur, close window
In the BODY tag I was using OnBlur to close a popup window, but it was causing the window to close if the user clicked inside the window. Is this the way it's supposed to work? I thought clicking inside the window would have been a Focus action.
6:30p
writing , deleting a cookie
I am going nuts. I have google and tried a dozen solutions...
(orig crap deleted)


SOLVED:
I decided to change how I write the cookie and add an expiration time. I think that was the problem.

function setCookie(name, value){
var today = new Date();
today.setTime (today.getTime() + 10 *60 * 1000); // ten minutes
var path = "/";
document.cookie=name + "="+value+"; expires=" + today.toGMTString() + "; path=" + path;
}


And then I modified the delete script:
function deleteCookie(name){
var today = new Date();
today.setTime (today.getTime() - 28 * 24 * 60 * 60 * 1000); // less 28 days
var path = "/";
document.cookie=name + "=null; expires=" + today.toGMTString() + "; path=" + path;
}

<< Previous Day 2006/07/03
[Calendar]
Next Day >>
About LiveJournal.com
Image