jqvmap - regionclick method not firing unless called in browser console
<p>I'm using the JQVMap plugin (http://jqvmap.com/) to create a map.  The plugin has a method called onRegionClick that lets you call a function if a region on the map is selected.  </p>

<p>I'm loading the map dynamically using a function called loadSlide, but for some reason the onRegionClick method isn't being called, nor is the bind method I've called afterward.  Strangely, if I load that bind method into my browser console after the page has loaded, it works great. </p>

<p>I'm totally happy to provide more code/context if necessary, but I'm at my wit's end with this.  Anyone familiar with this plugin and have experience with this problem?  Thanks!</p>

<p>Pertinent code below:</p>

<pre><code>function loadSlide(url,data) {
data.slide_id = $('#slide-data input#slide_id').val();
$.getJSON(url, data, function(response) {
    $('#slide-content').replaceWith(response.html);

        if ( $("#vmap").length &gt; 0 ) {

              $('#vmap').vectorMap({
                map: 'usa_en',
                backgroundColor: null,
                color: '#6a1912',
                hoverColor: '#fdb33f',
                selectedColor: '#fdb33f',
                enableZoom: true,
                showTooltip: true,
                onRegionClick: function(event, code, region) {
                    event.preventDefault();
                    $('input[type=hidden]#state-click').val(code.toUpperCase());
                    console.log($('input[type=hidden]#state-click').val());
                }
            });

            $('#vmap').bind('regionClick.jqvmap', function(event, code, region) {
                $('input[type=hidden]#state-click').val(code.toUpperCase());
                console.log($('input[type=hidden]#state-click').val());
            });

            setClickHandlers();
        }
    });
}
</code></pre>
