trying to call three methods but not working correctly with jQuery map
I have the following methods that are on a google maps. The methods work
fine like this:
arc.pLocations(ne, sw,m);
arc.pLikedLocations(ne, sw, m);
arc.pLikedItems(ne, sw, m);
However, I'd like to have them in an array like this that I can
subsequetnly call but this isn't working (I'd be the first acknowledge
this is an issue with me):
var selected_methods=[arc.pLocations,arc.pLikedLocations,arc.pLikedItems];
// Uncaught TypeError: Object #<Ri> has no method 'lng' - this is for a
variable called sw in pLikedLocations
$.map(selected_methods, function(val, i){
console.log("here is index:" + i);
val.call(ne,sw,m);
});
trying to wrap this with another closure but this also isn't working
$.map(selected_methods, (function(val, i){
console.log("here is index:" + i);
val.call(ne,sw,m);
})(val,i)); // Uncaught ReferenceError: val is not defined on this line!
I have the following I'm doing something really simple wrong. Can anyone
spot the issue and help me? It's saturday nigth and I want to be done with
this.
thx in advance
No comments:
Post a Comment