View Full Version : javascript question

09-03-2005, 11:15 PM
ok, heres my problem...

basically I have a variable and it stores a html form, you don't need to understand what the function does, but here it is

GEvent.addListener(map, 'click', function(overlay, point) {

map.addOverlay(new GMarker(point));
var html = "<form action='formp.php' method='post'>Add Information for this spot<br /><input type='text' name='text' /><br /><input type='hidden' name='point' value='' /> <input type='submit' name='submit'/></form>";
var marker = createMarker(point, html);

now my problem

In the html form, I need to include a hidden field with the value from the variable point (GEvent.addListener(map, 'click', function(overlay, POINT) { )

how can i mix text with another variable, in php I would use a . to concatenate two bits of info together like so:

var html "<html>" . point . "</html>";

how can you do that in javascript



09-04-2005, 12:20 AM
var html = "<html>" + point + "</html>";