/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] help please cant get program to run

I am a student and am completing a series of different programs to pass my unit

it is open book and one of the programs i am creating is to have a quiz in which the user answers 3 questions (what is the capitals of spain,scotland and france) now i have a basic program ready but it wont run and i have no idea why can anybody help.

here is my code so far:

<html>
<head>
<script type=”text/javascript”>
function show_prompt()
{
var qfrance=prompt(‘What is the capital of France’);
if( qfrance !== “Paris”);
for (i = 1 ; i <=1; i++){
window.alert(“that is incorrect!”);
prompt(‘try again What is the capital of France’);
}
{
var qspain=prompt(‘What is the capital of Spain’);
if( qspain !== “Madrid”);
for (i = 1 ; i <=1; i++){
window.alert(“that is incorrect!”);
prompt(‘ try again What is the capital of Spain’);
}
{
var qscotland=prompt(‘What is the capital of Scotland’);
if( qscotland !== “Edinburgh”)
for (i = 1 ; i <=1; i++){
window.alert(“that is incorrect!”);
prompt(‘ try again What is the capital of France’);
}
window.onload=show_Prompt();
</script>
</head>
</html>

please help thanks

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@tyson642authorMay 04.2011 — Managed to get it working just has to use body_onload to activate the prompt ?

this can be closed now
×

Success!

Help @tyson642 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...