• Help
  • Search
  • Login
  • Register
  • Home

Forum: web design and graphics community

Celestial Star Forum > Web Development > Coding > Javascript Help
Pages: [1]
« previous next »
  Print  
Author Topic: Javascript Help  (Read 359 times)
AiraJean
Skogul
**
Posts: 32



View Profile
Javascript Help
« on: July 10, 2007, 03:00:17 AM »

Code:
<script LANGUAGE="JavaScript">
<!--;
// numberguess is by Lancer - written 4 Jan 1999
// lancer@kp.planet.gen.nz

var guessme=Math.round(Math.random()*(99)+1);
var speech='Guess my number (from 1 to 100)';

function process(mystery) {
var guess=document.forms.guessquiz.guess.value;
var speech='"'+guess+ '" does not make sense to me.';
document.forms.guessquiz.guess.value='';

if (guess==mystery)
{
document.forms.guessquiz.prompt.value='Congratulations! '+mystery+' is correct!';
alert ('Well done - the mystery number is '+mystery+'! \n\nPress this button to reload the page for another game.');
speech='';
document.location=document.location;
}

if (mystery<guess)
{
speech='Less than '+ guess;
}

if (mystery>guess)
{
speech='Greater than '+ guess;
}

if (guess=='')
{
speech='You didn\'t guess anything!'
}

document.forms.guessquiz.prompt.value=speech; document.forms.guessquiz.guess.focus();

}

// end hide -->
</SCRIPT>


What would I change so that when the right number is guessed they are refered to a different page?
Logged
Firebender
Skogul
**
Posts: 48


^ icon and sig by me


View Profile WWW
Re: Javascript Help
« Reply #1 on: July 10, 2007, 09:20:08 PM »

What are you trying to use the javascript for and where do you find it? If I know what you are trying to do with it  and where it is from I can help you.
Logged



Trap all Day, Play all Night, Dis is da Life of a G O  G E T T A
AiraJean
Skogul
**
Posts: 32



View Profile
Re: Javascript Help
« Reply #2 on: July 11, 2007, 01:46:50 AM »

When someone guesses the right number i want it to forward them to a new page.
Logged
Pages: [1]
  Print  
« previous next »
 
Jump to:  

  • Welcome, Guest
  • Members login
  • Register for free

General

  • General
  • New members
  • Announcements
  • Support / Suggestions

Art boards

  • Creative mediums
  • Requests and offers
  • Tutorials
  • Celestial Star tutorials

Web development

  • Coding
  • Web design
  • Advertisements / affiliation

Off-topic

  • The non-sense
  • Ententainment

Go up
eXTReMe Tracker
  • Valid XHTML
  • Valid CSS
Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC | Seo4Smf v0.2 © Webmaster's Talks
Loading...