LiveZilla Live Help
 


Go Back   Chime Host - Web Hosting Forum > World Wide Web > Programming / Scripting / Coding Forum > Javascript
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Javascript Need help with the (primarily) client-side programming language? This is the place. Includes discussion on AJAX (Asynchronous JavaScript and XML).

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-22-2009, 06:15 PM
Junior Member
 
Join Date: Oct 2009
E-Unit923 is on a distinguished road
Default Making a basic JavaScript program. I'll give points Thanks?

Okay so it is not looking how I want it, and I know i am only missing a few things, maybe very minor. But I want the program to first prompt 'How many numbers...' and then ask 'What is the 1st number?' etc etc and then calculate the sum and average, and ask if you want to re-do or not. If you launch this code, a few of the prompts are there but its not connecting. Thanks in advance!

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Conditionals</title>
<script type="text/javascript">
//<![CDATA[
function runJS()
{
var sum = 0;
var average = 0;
var count = parseFloat(prompt("How many numbers do you want to sum up?", "3"));
average = sum/3;
alert("The average is: " + average + ".\nThe sum is: " + sum + ".");
}
//]]>
more = prompt("Would you like to do another calculation? (Y/N)", "Y");
</script>
</head>
<body onload="runJS();">
</body>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
10 free points! Positive Points of a Mobile Phones. Crystal Unicorn General - Education & Reference 0 08-04-2008 06:09 PM
Visual Basic naives Programming / Scripting / Coding Forum 7 02-02-2008 09:19 PM
Windows Vista Basic BOoBOo Windows Vista 0 04-05-2007 02:58 AM
Some basic questions... wsc Web Hosting Support 1 09-02-2006 07:23 PM
basic html help Pelle Programming / Scripting / Coding Forum 25 08-09-2003 06:35 PM


All times are GMT +1. The time now is 12:47 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright ChimeHost, a Profuse Solutions LLC company