File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes Beginner - looking for assistance with functions Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "Beginner - looking for assistance with functions" Watch "Beginner - looking for assistance with functions" New topic
Author

Beginner - looking for assistance with functions

Dawn Wendorf
Greenhorn

Joined: Jan 26, 2012
Posts: 5
Just started a beginning web programming class and I'am working with JavaScript. My question is "how do you add a space between two variable alerts within a function?" The variables ask for first and last name and the function displays these two names but I am having difficulty adding a space between the first and last name when the "Greet" function appears. Any assistance is greatly appreciated. Here is the code:

Bear Bibeault
Author and opinionated walrus
Marshal

Joined: Jan 10, 2002
Posts: 50691

Java isn't JavaScript, so you seem to have posted in the wrong forum. I've moved your post to the HTML/JavaScript forum though, so no worries!

Welcome to the Ranch!


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15003


That is a string, you are not adding variables together.

With a single variable it would be Greet(who1);

Eric
Dawn Wendorf
Greenhorn

Joined: Jan 26, 2012
Posts: 5
Thank you Eric. I appreciate your assistance.
Lalit Mehra
Ranch Hand

Joined: Jun 08, 2010
Posts: 269

use a two argument function ...

e.g. Greet(who1, who2)

regards


ARK -->> One Act of Random Kindness at a Time ... Let's change the world ...
One More Thing: if you wish to stop piracy develop open source apps
 
 
subject: Beginner - looking for assistance with functions
 
Threads others viewed
input/output stream
please help to make this function work
Problem compiling the code
Java Script-I'm not possible to refer the external .js
Portlets and External Javascript Files
developer file tools

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture