Bind method to call a function
i AM TRYING TO CALL a function on button click event, but the function is running on page load event.So i have used bind method to run the function on button click event.
My code is
var button1 = new OpenLayers.Control.Button({title:'title1',
displayClass: "button1Display",
trigger: myFunction1.bind('title1')});
function myFunction1(data1) {
alert(data1);
}
with the above code, function is called on the button click event only, but data1 is undefined.
please tell me where i am doing mistake.