I have the following script which is calling a map() function:
$(function () {
$.getScript("https://www.google.com/jsapi", function() {
google.load("maps", "3", { callback: function() {
console.log("loaded");
$.mapit();
}});
});
});
Where map is the following function:
$(function () {
$.fn.mapit = function () {
console.log("map called");
return $(this);
} // mapit
});
On my console I see "loaded" but not "map called" and I do not get any error.
What am I missing?