...

View Full Version : Delete a cookie [inline code]



scrupul0us
02-20-2007, 05:58 PM
is this the correct syntax for deleting a cookie named "weather"


<a href="" onclick="javascript:document.cookie = "weather=;";">Clear Cookie</a>

nikkiH
02-20-2007, 11:23 PM
No. :)

Why did you want to do this inline?
Cookie functions are a dime a dozen. You can get a cookie.js (http://www.google.com/search?source=ig&hl=en&q=cookie.js&btnG=Google+Search) file and just call the remove cookie function, assuming it is removeCookie(cookiename) like
<a href="" onclick="removeCookie('weather');">Clear Cookie</a>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum