0

I have been using the TW-SACK library in my plugin using the below code:

    <?php wp_print_scripts(array('sack')); ?>
    <script type="text/javascript">
    //<![CDATA[
        where_go_count = new sack("<?php bloginfo( 'url' ); ?>/index.php");    
        where_go_count.setVar( "wherego_id", <?php echo $id ?> );
        where_go_count.setVar( "wherego_sitevar", document.referrer );
        where_go_count.method = 'GET';
        where_go_count.onError = function() { return false };
        where_go_count.runAJAX();
        where_go_count = null;
    //]]>
    </script>

This used to be the standard format of code on https://codex.wordpress.org/AJAX_in_Plugins, which has since changed.

I am not sure as to how I can modify the above code to use the new format with wp_ajax_ajax

Appreciate any guidance on this.

2

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.