michshelly
01-30-2006, 06:19 AM
Hi once again,
What is wrong with this code, please? I have tried every possible combination. Half of it is right. The part that is wrong is when you click on cancel, and the next box comes up saying "That's great". It's supposed to pop up saying "oh, that's a shame".
What I am not sure of is the calling function. Your input and advise would be really appreciated.
Thanks
Michelle
<html>
<head>
<title> Would you like some coffee?</title>
<script type="text/javascript">
<!-- HIDE FROM INCOMPATIBLE BROWSERS
function coffee () {
window.confirm("Would you like a cuppa?");
if (answer="true")
window.alert("That's great");
else {
(answer="false")
window.alert("Oh, that's a shame");
}
}
//STOP HIDING FROM INCOMPATIBLE BROWSERS -->
</script>
</head>
<body>
<p> Invitation </p>
<script type="text/javascript">
<!-- HIDE FROM INCOMPATIBLE BROWSERS
coffee("window.confirm");
// STOP HIDING FROM INCOMPATIBLE BROWSERS-->
</script>
</body>
</html>
What is wrong with this code, please? I have tried every possible combination. Half of it is right. The part that is wrong is when you click on cancel, and the next box comes up saying "That's great". It's supposed to pop up saying "oh, that's a shame".
What I am not sure of is the calling function. Your input and advise would be really appreciated.
Thanks
Michelle
<html>
<head>
<title> Would you like some coffee?</title>
<script type="text/javascript">
<!-- HIDE FROM INCOMPATIBLE BROWSERS
function coffee () {
window.confirm("Would you like a cuppa?");
if (answer="true")
window.alert("That's great");
else {
(answer="false")
window.alert("Oh, that's a shame");
}
}
//STOP HIDING FROM INCOMPATIBLE BROWSERS -->
</script>
</head>
<body>
<p> Invitation </p>
<script type="text/javascript">
<!-- HIDE FROM INCOMPATIBLE BROWSERS
coffee("window.confirm");
// STOP HIDING FROM INCOMPATIBLE BROWSERS-->
</script>
</body>
</html>