== '') { 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=' + 'BedsOkBLOBR4nM4W52xTcBhb-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': 'BedsOkBLOBR4nM4W52xTcBhb-gzGzoHsz', 'X-LC-Key': 'EEaRfb6dCMaS38laDCkSYhM9', 'Content-Type': 'application/json', }, data: data }); }; if ($('.post-title-link').length >= 1) { showTime(Counter); } }); });