TIP: trying googling the answer before posting, you'll find that more times than not someone else somewhere has had the same request and posted an answer online.
----
I have recently been semi-converted to ensuring all my code (well most of it) works in both javascript and non-javascript enabled browsers
<script>
funtion confirmDelete()
{
var blnResponse = confirm("Are you sure you want to delete?");
alert(blnResponse);
if (blnResponse == "true")
{
alert("true - OK button was pressed.");
}
if (blnResponse == "false")
{
alert("false - NO button was pressed.");
}
}
</script>
<body>
<a href="mypage.html" onclick="return confirmDelete();">delete this</a>
i'm getting an error:
line 6 where the word function is.
char 9 - ";" is required.
fun[red]c[/red]tion confirmDelete()
{
if (confirm("Are you sure you want to delete?"))
{
alert("true - OK button was pressed.");
}
[red]else[/red]
{
alert("false - NO button was pressed.");
}
}
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.