Book Section
-----
TY JavaScript 3rd Ed.
Teach Yourself JS 1.5
Teach Yourself DHTML
Teach Yourself JS 1.3
LLWW: JavaScript

General Section
-----
Discussion Forum
Articles / Tips
JavaScript Links
About the Author
Privacy Policy
Contact Me



Other Sites
-----
Website Workshop
JavaScript Weblog

JavaScript Workshop Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
JavaScript Simple assignemt

 
Post new topic   Reply to topic    JSWorkshop Forum Index -> JavaScript
View previous topic :: View next topic  
Author Message
mayorvlf
New member
New member


Joined: 14 Jul 2012
Posts: 3
Location: Dallas, TX

PostPosted: Sat Jul 14, 2012 1:17 pm    Post subject: JavaScript Simple assignemt Reply with quote

Hello,
I have to create a simple JavaScript where I prompt the user to enter 2 names and then send those names to a functions named Greet with 2 parameters and display the 2 names. Below it is my code:
<html>
<head>
<title>Greeting</title>
<script LANGUAGE="JavaScript">
function Greet (who1, who2){
alert("Greetings, " + who1 + " " + who2)
}
</script>
</head>
<body>

<script type="text/javascript">

var name1=prompt("What is your name?");
var name2=prompt("What is your Last name?");
Greet(name1, name2);
</script>
</body>
</html>

Does anyone know of a more simple way of accomplishing this task?
Back to top
View user's profile Send private message
phil karras
Senior Member
Senior Member


Joined: 15 Jul 2002
Posts: 1776
Location: MD

PostPosted: Mon Jul 16, 2012 3:20 am    Post subject: Reply with quote

No, that's about as simple as it gets. Well done. You don't even have a page.
_________________
Phil K
Circle Software Consulting
Test website: http://cs.yrex.com/
Guidelines for Posting: http://www.jsworkshop.com/posting.html
IHBAAA = It Has Been Asked And Answered
KISS: http://www.jsworkshop.com/bb/viewtopic.php?t=508
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    JSWorkshop Forum Index -> JavaScript All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group
(c) 1997-2002 Starling Technologies and Michael Moncur. Portions (c) Sams Publishing.