Skip to content


Determine your fate

<html>
<head>
<title>MAGIC 8 BALL</title>
<script language="javascript">
var ques= prompt('Enter your yes/no question, so we can determine you fate', ' ');

if ( (ques==' ') || (ques==null) )
 {
   ques="None";
 }
</script></head>
<body bgcolor="#c0c0c0" text="black" link="fuschia" vlink="red">
<br><br><center><h1>Magic 8 Ball</h1><br><br><br><br>
<SCRIPT language="JavaScript">

 document.write("<center><p></b>Your question was:<br><p><b> " + ques + " </b></p></center>");

</SCRIPT>

<br><br>

<center><p>Your answer is:<br><br>
<center><table align="center">
<tr><td><font color="black">
<script language="JavaScript">

var Quotation=new Array() // do not change this!

// Set up the quotations to be shown, below.
// To add more quotations, continue with the
// pattern, adding to the array.  Remember
// to increment the Quotation[x] index!

Quotation[0] = "<p><b>Yes";
Quotation[1] = "<p><b>Probably";
Quotation[2] = "<p><b>Definitely";
Quotation[3] = "<p><b>Mabey";
Quotation[4] = "<p><b>Almost Definitely";
Quotation[5] = "<p><b>No";
Quotation[6] = "<p><b>Dream on";
Quotation[7] = "<p><b>Defentently Not";
Quotation[8] = "<p><b>Probably Not";
Quotation[9] = "<p><b>Not Gonna Happen";
Quotation[10] = "<p><b>Hard to Tell";
var Q = Quotation.length;
var whichQuotation=Math.round(Math.random()*(Q-1));
function showQuotation(){document.write(Quotation[whichQuotation]);}
showQuotation();
  </script>
</td></tr>
</table>
</font><br><br>
<center>
<input type="button" value="Ask Another Question..." onClick="history.go(0)">
<br><br><br><br>
</body></html>
Related Posts with Thumbnails

Enter your email address:

Delivered by FeedBurner

Be Sociable, Share!

Posted in Javascript.


2 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. sweatblock says

    I definately beleive that plenty other people who read your article above would agree. Very useful information, keep up the good work! Cheers

  2. Jobin Martin says

    Welcome.



Some HTML is OK

or, reply to this post via trackback.

CommentLuv badge