homepage Welcome to WebmasterWorld Guest from 54.145.238.55
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
Using input in function - newbie
tomhumf

5+ Year Member



 
Msg#: 3937760 posted 4:50 pm on Jun 21, 2009 (gmt 0)

Hi,

This is pretty much the first time I have used javascript...

I'm using the function below to get google map directions. It works fine if I use a normal string input, i.e

directions.load("from: address 1 to: address 2");

But I am having trouble using the clientaddress input. From what I have read I thought you could concatenate the string like I have done below. I know clientaddress is being received by the function because I can use Alert to display it from within function.

Any help would be appreciated
.......................................................

function getdirections(clientaddress){
var clientaddress;

map = new GMap2(document.getElementById("map_canvas2"));
directionsPanel = document.getElementById("my_textual_div");
map.setCenter(new GLatLng(49.496675,-102.65625), 3);
directions = new GDirections(map, directionsPanel);


directions.load("from: " + clientaddress + "to: address 2");

}

 

tomhumf

5+ Year Member



 
Msg#: 3937760 posted 5:00 pm on Jun 21, 2009 (gmt 0)

Nevermind, It's working now, I just needed space after from: and before to:

directions.load("from: " + clientaddress + " to: address2");

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved