• Resolved Carl M.

    (@ccmanz)


    Hi! Great plugin and it works awesome!

    Just hit a road block, and would like your thoughts on how to run a jQuery snippet when the body class (added by) geoeip-detect is added via Ajax?

    Sample

    $(document).ready(function($) {
    if ($('body').hasClass('geoip-country-AU')) { //class added by geo-ip detect via AJAX
    $('#pum-3882').popmake('open');
    }
    });

    • This topic was modified 7 months, 2 weeks ago by Carl M..
Viewing 1 replies (of 1 total)
  • Plugin Author Benjamin Pick

    (@benjaminpick)

    Currently this is possible like this:

    jQuery(document).ready(function($) { geoip_detect.get_info().then(function(record) {
    
    if (record.get('country') == 'AU') { .... }
    
    });
    
    });

    But yes, emitting a event could be an option, too… I am considering to add it in a future version.

Viewing 1 replies (of 1 total)
  • The topic ‘Trigger custom jQuery when Ajax Endpoint is enabled on adding body class’ is closed to new replies.