Confirm doesn't stop on cancel

hello,
i m trying to make a person stay on same page on cancel, but the confirm takes the user to the next page like they press ok. how can i stop it?
<!–
function ubs(){
var check = confirm(“Are You Sure?”);
if(check){
redirect(“http://www.yahoo.com/”)
}else{
alert(“Phew”);
}
}
//–>

You need to add a return false; statement to make sure nothing follows it


function ubs(){
var check = confirm("Are You Sure?");
if(check){
redirect("http://www.yahoo.com/")
}else{
alert("Phew");
return false;
}
}