Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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.

share|improve this question
    
Note that you shouldn't be using wp_print_scripts(). –  RRikesh Apr 15 '13 at 7:35
    
Agreed. But, I'd like to change the entire SACK query and not just wp_print_scripts –  Ajay Apr 21 '13 at 8:38
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.