<!-- 第一步:把如下代碼加入<body>區域中 -->
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function getInfo() {
doyou = confirm("考慮一下選擇哪個喲? (OK = Yes Cancel = No)"); //Your question.
if (doyou == true)
alert("呵呵,你選擇了'Yes',你真勇敢喲"); //If your question is answered Yes.
else
if (doyou == false)
alert("怎麼能選擇'NO'呢?難道你不怕倒霉嗎?"); //If your question is answered No.
if (doyou == false)
history.go(-1); //After answered No, the action. (In < this < case, it sends you back 1 page!)
}
// End -->
</script>
<!-- 第二步:把如下代碼加入<body>區域中 -->
<body onLoad="getInfo()">