BleepingComputer.com: Javascript help needed

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Javascript help needed Javascript help needed

#1 User is offline   Harley2006 

  • New Member
  • Pip
  • Find Topics
  • Group: Members
  • Posts: 9
  • Joined: 26-February 11
  • Gender:Male
  • Location:Woking, UK

Posted 14 May 2011 - 03:14 PM

Does anyone understand HTML/Javascript programming ?

My wife is doing a course and is having difficulty getting this to run ?
any help would be very much appreciated as to why it does not work as it should.
Many thanks in advance.

<HTML>
<HEAD>
<TITLE>Make a Story</TITLE>
<script language="JavaScript">

var heroGender, heroName, petType, petName;
heroGender = window.prompt('Is the hero female or male? Enter F or M', 'F');
heroName = window.prompt('What is the hero\'s name?','');
petType = window.prompt ('type of pet','');
petName = window.prompt ('the name of the pet','');

document.write ('Once upon a time there was a ');

var girl, boy;
girlOrboy = window.prompt ('is it girl or a boy? Enter girl or boy','');
girlOrboy = parsefloat ('girlOrboy');
if ('girl');
document.write('girl');
else ('boy');
document.write('boy');
// write out the remaining output
// here
</SCRIPT>
</HEAD>
<BODY>
</BODY>
</HTML>

#2 User is offline   petewills  

  • Retired
  • PipPipPipPipPipPip
  • Find Topics
  • Group: Members
  • Posts: 1,123
  • Joined: 15-October 07
  • Gender:Male

Posted 16 May 2011 - 08:00 AM

Try posting in Software/Programming forum. You could get overlooked here.
Is this code written by your wife. I can get the first prompt script to run, but there seems to be code missing.
Clarify the exercise and I'm sure there will be suggestions for you from members who are more clued up than me in HTML/Javascript.

#3 User is offline   Harley2006 

  • New Member
  • Pip
  • Find Topics
  • Group: Members
  • Posts: 9
  • Joined: 26-February 11
  • Gender:Male
  • Location:Woking, UK

Posted 16 May 2011 - 11:22 AM

thanks for looking pete, managed to get it all sorted now thanks. there is another part after that needed to be added as next part of exercise.
will use Software/Programming section of forum next time its needed <_<

#4 User is offline   petewills  

  • Retired
  • PipPipPipPipPipPip
  • Find Topics
  • Group: Members
  • Posts: 1,123
  • Joined: 15-October 07
  • Gender:Male

Posted 16 May 2011 - 12:32 PM

Glad you sorted it. Thanks for letting us know. :)

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users