Is there any way in jQuery to get the name of an object as a string?
i.e. if I have
markers.events = {
click: function(event){},
drag: function(event){}
};
I would like to get a string "click"
or "drag"
Is this possible inside a $.each(myObj, function(){})
?
I need to do the following (hopefully) on the object stated above:
$.each(markers.events, function(i, event){
google.maps.event.addListener(marker, "click/drag", event);
})