Brett Gregson
Brett Gregson

Reputation: 5913

jQuery click function not working with Google Maps

I am loading a InfoBox on a google map when an element on the map is clicked. The content inside the info window is loaded asynchronously with jQuery

I am trying to recognize when one of the elements inside the ajax loaded content is clicked (using jQuery) but I can't get jQuery to recognize the click event.

I have tried using a live click event but it is still not being recognized:

$(function(){
    $('.ajax-trigger-add-to-watchlist').live("click", function(){
        alert('1');
    });
});

I am guessing this is just some weird behavior with the google maps API. Any ideas?

Upvotes: 0

Views: 341

Answers (1)

Brett Gregson
Brett Gregson

Reputation: 5913

Still not sure what was going on with the jQuery part, but I solved the problem by using an onclick inline call on the trigger element

Upvotes: 1

Related Questions