I recently created a link on a website for an onClick event, but the javascript code doesn't work. Here is the code for the main page:
Quote:
<html><head><title>WhereAmI.i8.com -- Dollar Tracker!</title></head> <body bgcolor = "springgreen" link = blue vlink = red alink = white>
<h1><center><font color = "maroon">Where Am I?: Dollar Map</font></center></h1>
<hr width = 200 color = "orange" height = 20>
<table bgcolor = "yellow" border = 0><tr><td>Follow these links:</td></tr></table>
<ul type = "square">
<li><a href = "email.htm" onclick = "isCode()">Report a Dollar</a> [need dollar code].</li>
<li><a href = "locations.htm">Interesting locations</a> where the dollars have been.</li>
</ul>
<table bgcolor = black><tr><td><font color = white>
<h2>About "Where Am I?"</h2>
<u>whereami.5u.com</u> is a site where people around the world report where a dollar has been. Right now, five dollar bills are floating around the US, waiting to be reported in. Reporting a dollar requires a password, but viewing interesting places doesn't.
</td></tr></table>
</body>
</html>
|
Here is the code for isCode() in the "checkCode.js" file [Edited however, for privacy reasons: just the four digit numbers]
Quote:
function isCode(){
var code = prompt("Enter the dollar code located on your dollar bill.\n" +
"If the incorrect code is given, then you will be directed back to the homepage.");
if (code == #### || code == #### || code == #### || code == #### || code == #### ){
window.location.replace("email.htm");
}
else{
window.location.replace("index.htm");
}
}
|
Can anyone see the problem? I know I posted this before and made the mistake of making a link.