hi to all,
i’ve this javascript function :
function km(str_dir) {
map = new GMap2(document.getElementById("map_canvas"));
directionsPanel = document.getElementById("route");
directions = new GDirections(map, directionsPanel);
directions.load(str_dir);
GEvent.addListener(directions,"load", function() {
var dist= directions.getDistance().meters;
return dist;
});
}
i call the function from the controller in this way:
@arg=“500 Memorial Drive, Cambridge, MA to Fenway Park, Boston, MA”
page.call (“km”, @arg)
all work…
the problem is that i want to take the result of javascript function in
the controller…
How can i use the variable “dist” inside the controller??
thanks in advance
andre