View Full Version : help to Call Function

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))))



09-21-2005, 11:58 PM
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)

09-23-2005, 02: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,