I'm having a problem getting a 'change' event to register with the following code
var map = function(){
function addMapTriggers(){
$("#map_form select").change(getDataWithinBounds);
}
return{
init: function(){
getDataWithinBounds();
addMapTriggers();
}
};
}();
and in a jquery document.ready
$(function(){
map.init();
});
So I get my intial data, then every time I change one of the selects, I get the map data again (getDataWithinBounds sends an ajax call). Problem is, it doesn't work, the change event is never added.
However, if, in the console I type map.init(); it does work. This is weird, I don't understand how there is any difference whatsoever? What am I missing here? I'm testing this on safari AND firefox with the exact same behavior