Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

Using input in function - newbie



4:50 pm on Jun 21, 2009 (gmt 0)

5+ Year Member


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");



5:00 pm on Jun 21, 2009 (gmt 0)

5+ Year Member

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

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


Featured Threads

Hot Threads This Week

Hot Threads This Month