} } }) .fail(function ({ responseJSON }) { console.log('LeanCloud Counter Error: ' + responseJSON.code + ' ' + responseJSON.error); }); } $(function() { $.get('https://app-router.leancloud.cn/2/route?appId=' + 'YvgheVT82eRRYHM6xtvaEL6l-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': 'YvgheVT82eRRYHM6xtvaEL6l-gzGzoHsz', 'X-LC-Key': 'uwmRd9pGJeDmqKQNmalNsosO', 'Content-Type': 'application/json', }, data: data }); }; if ($('.post-title-link').length >= 1) { showTime(Counter); } }); });