W3Schools tutorial example not working with Coda on Mac
Posted
by Mark Szymanski
on Stack Overflow
See other posts from Stack Overflow
or by Mark Szymanski
Published on 2010-05-05T00:06:34Z
Indexed on
2010/05/05
0:18 UTC
Read the original article
Hit count: 456
I am following a JavaScript tutorial on the W3Schools website and I have the following code:
<html>
<head>
<title>Hello!</title>
</head>
<body>
<script type="text/javascript">
function confirmShow
{
var r = confirm("Press one...")
if (r == true)
{
alert("Button pressed == OK")
}
if (r == false)
{
alert("Button pressed == Cancel")
}
}
</script>
<input type="button" onclick="confirmShow()" value="Show Confirm Box" />
</body>
</html>
and whenever I preview it in Coda or in Safari the alert never shows up.
Thanks in advance!
© Stack Overflow or respective owner