...

View Full Version : help to Call Function



Sysop_Neo
09-21-2005, 04: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

Mongus
09-22-2005, 12:58 AM
You have to know the name of the cookie you want to delete. If the cookie name was "myCookie" then your code would look like this:

if (!stay)
deleteCookie("myCookie");

Sysop_Neo
09-23-2005, 03:20 AM
thanks .... sugestion for codingforums staff team :

a "check up" in post's topic ... example here now my question is answered i change the " ? " in topic for a "(answered icon)"


Bye all,

Neo



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum