Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Javascript help needed


  • Please log in to reply
3 replies to this topic

#1 Harley2006

Harley2006

  • Members
  • 9 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Woking, UK
  • Local time:12:39 PM

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>

BC AdBot (Login to Remove)

 


#2 petewills

petewills

  • Members
  • 1,378 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Birmingham, UK
  • Local time:06:39 PM

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 Harley2006

Harley2006
  • Topic Starter

  • Members
  • 9 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Woking, UK
  • Local time:12:39 PM

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 petewills

petewills

  • Members
  • 1,378 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Birmingham, UK
  • Local time:06:39 PM

Posted 16 May 2011 - 12:32 PM

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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users