ar i = 0; i < entries.length; i++) { var url = entries[i]; var element = document.getElementById(url); var countSpan = $(element).find(COUNT_CONTAINER_REF); if (countSpan.text() == '') { countSpan.text(0); } } }) .fail(function ({ responseJSON }) { console.log('LeanCloud Counter Error: ' + responseJSON.code + ' ' + responseJSON.error); }); } $(function() { $.get('https://app-router.leancloud.cn/2/route?appId=' + 'ENrb7oH81PLu5Q4GTsl5EDc0-gzGzoHsz') .done(function({ api_server }) { var Counter = function(method, url, data) { return $.ajax({ method: method, url: 'https://' + api_server + '/1.1' + url, headers: { 'X-LC-Id': 'ENrb7oH81PLu5Q4GTsl5EDc0-gzGzoHsz', 'X-LC-Key': 'OCcGGqLeUGgO8XdNA1q0LV5W', 'Content-Type': 'application/json', }, data: data }); }; if ($('.post-title-link').length >= 1) { showTime(Counter); } }); });