Support » Plugin: Count per Day » Externalize JS

  • Is there a reason the AJAX version is written into the page instead of being an external JS file? By being written, it doesn’t play well with caching plugins like W3 Total Cache. If it was an external file, it would obey defer statements and load in order iwth jQuery. I request that you externalize this javascript into a registered script within wordpress so it can be handled better. Thanks

    <script type=”text/javascript”>/*<![CDATA[*/var cpdTime=new Date().getTime()/1000;jQuery(document).ready(function()
    {jQuery.get(‘/wp-admin/?page=cpd_ajax&f=count&cpage=2&time=’+cpdTime,function(text)
    {var cpd_funcs=text.split(‘|’);for(var i=0;i<cpd_funcs.length;i++)
    {var cpd_daten=cpd_funcs[i].split(‘===’);var cpd_field=document.getElementById(‘cpd_number_’+cpd_daten[0].toLowerCase());if(cpd_field!=null){cpd_field.innerHTML=cpd_daten[1];}}});});/*]]>*/</script>

  • The topic ‘Externalize JS’ is closed to new replies.