Sysop_Neo
09-21-2005, 03:57 PM
hi all :thumbsup:
well i need a litle help with a code ... i want that when the user enter 'cancel' on the confirm message the cookie is deleted. So if im correct and if is a good code the function for delete cookie is:
function deleteCookie(name, path, domain) {
if (getCookie(name)) {
document.cookie = name + "=" +
((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") +
"; expires=Thu, 01-Jan-70 00:00:01 GMT"
}
and i want to give a option at user for he/she delete the cookie. the problem is that i dont know the line code for call the function deletecookie :confused:
for Know the code i have is:
var stay=confirm("Hello " + name + "!" + " You have " + age + " years old. Press 'ok' if is correct, 'cancel' if not")
if (!stay)
[here the line code for call the function delete cookie if im correct, but i dont know what is]
document.write ("Hi" + name )
Thanks for the possible help (y))))
Bye,
Neo
well i need a litle help with a code ... i want that when the user enter 'cancel' on the confirm message the cookie is deleted. So if im correct and if is a good code the function for delete cookie is:
function deleteCookie(name, path, domain) {
if (getCookie(name)) {
document.cookie = name + "=" +
((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") +
"; expires=Thu, 01-Jan-70 00:00:01 GMT"
}
and i want to give a option at user for he/she delete the cookie. the problem is that i dont know the line code for call the function deletecookie :confused:
for Know the code i have is:
var stay=confirm("Hello " + name + "!" + " You have " + age + " years old. Press 'ok' if is correct, 'cancel' if not")
if (!stay)
[here the line code for call the function delete cookie if im correct, but i dont know what is]
document.write ("Hi" + name )
Thanks for the possible help (y))))
Bye,
Neo