Lets say I have a javascript function call moveItem which takes two parameters source and destination.
I want to assign this function the the click-event of several buttons, each having different source and destinations.
OK, so without the parameter I would do something like this:
$('#myButton1').click(moveItem);
function moveItem() {
...
}
But what if moveItem looks like this:
function moveItem(source, destination) {
...
}
this doesn't seem to work:
$('#myButton1').click(moveItem('foo','bar'));