LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 12-07-2006, 04:57 PM   #1
Tux-O-Matic
Member
 
Registered: Sep 2006
Distribution: Fedora Core 5 (no internet)
Posts: 95

Rep: Reputation: 15
Javascript & HTML


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.
 
Old 12-07-2006, 05:32 PM   #2
mrcheeks
Senior Member
 
Registered: Mar 2004
Location: far enough
Distribution: OS X 10.6.7
Posts: 1,690

Rep: Reputation: 50
Maybe you need window.location.href instead of window.location.replace depending on the browser you useé
 
  


Reply

Tags
code, javascript


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
JavaScript: Want to get the amount of html 'names'. RHLinuxGUY Programming 1 12-06-2006 01:52 PM
HTML or Javascript combo select rblampain Programming 5 08-29-2006 06:14 AM
Javascript / HTML <select> tag djgerbavore Programming 3 04-23-2005 10:51 AM
Html Javascript help apt Programming 3 03-20-2005 11:46 PM
changing an HTML table with javascript eantoranz Programming 2 10-29-2004 12:21 PM


All times are GMT -5. The time now is 04:45 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration