Title: Function not auto-refreshing
Last modified: August 22, 2016

---

# Function not auto-refreshing

 *  Resolved [worldtravlr](https://wordpress.org/support/users/worldtravlr/)
 * (@worldtravlr)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/function-not-auto-refreshing/)
 * Thanks so much for this plugin. It is exactly what I was looking for and easy
   enough for a non programer like myself to use!
 * I am having having some trouble getting the number to auto refresh on the page.
   I have added the code you provided to the page header, but it does not seem to
   update dynamically when I change the numbers in the functions.php file and re-
   save for testing or even update the database. Any ideas how to get the auto updating
   to work? Glad to send you more info via email, but the page is blocked as it 
   is pre-launch.
 * Thanks so much.
 * Griffin
 * [https://wordpress.org/plugins/ajaxize/](https://wordpress.org/plugins/ajaxize/)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Thread Starter [worldtravlr](https://wordpress.org/support/users/worldtravlr/)
 * (@worldtravlr)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/function-not-auto-refreshing/#post-5338347)
 * Additionally, my website uses W3 Total Cache and Cloudflare, but I was hoping
   AJAX would be able to update the numbers dynamically and not be affected by caching.
   Is that correct? Thanks for any help you can offer.
 *  Thread Starter [worldtravlr](https://wordpress.org/support/users/worldtravlr/)
 * (@worldtravlr)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/function-not-auto-refreshing/#post-5338438)
 * Looks like adding jQuery(document).ready(function($) { }) fixes it. Huge thanks
   to [http://www.dotstudio.co.uk](http://www.dotstudio.co.uk) for helping me figure
   it out and thanks again for the great plugin!
 *     ```
       <script>
       var refreshId;
       jQuery(document).ready(function($) {
   
       refreshId = setInterval(function() {
   
           var $data = $('div[id*="loaded_ajaxize_this:wc_product_sold_count:de15b9d8398e5ba659ac99d2cbc154ec5254d088"]');
           $data.each( function() {
               $data.fadeOut(2000, function() {
                   var newquery = $.query.set('ajaxize_this', $data.attr('id')).set('_wpnonce', ajaxizeParams._wpnonce);
                   $data.load(location.pathname + newquery, function() {
                       $data.fadeIn(2000);
                   });
               });
           });
   
           return false;
       }, 10000); 
   
       });
       </script>
       ```
   
 *  Plugin Author [yoav.aner](https://wordpress.org/support/users/yoavaner/)
 * (@yoavaner)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/function-not-auto-refreshing/#post-5338488)
 * Thanks for keeping me posted. I’ll try to update the FAQ to reflect this, so 
   others can avoid this.
 *  Thread Starter [worldtravlr](https://wordpress.org/support/users/worldtravlr/)
 * (@worldtravlr)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/function-not-auto-refreshing/#post-5338491)
 * No problem and thanks again for the great plugin!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Function not auto-refreshing’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/ajaxize.svg)
 * [Ajaxize](https://wordpress.org/plugins/ajaxize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ajaxize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ajaxize/)
 * [Active Topics](https://wordpress.org/support/plugin/ajaxize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ajaxize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ajaxize/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [worldtravlr](https://wordpress.org/support/users/worldtravlr/)
 * Last activity: [11 years, 6 months ago](https://wordpress.org/support/topic/function-not-auto-refreshing/#post-5338491)
 * Status: resolved