$(function () { setTimeout("$_statnew.onstat(1)", 500); console.log("stat loaded"); }); var $_statnew = new (function () { var o = this; var state = false; this.onstat = function (n) { if (!state) { state = true; console.log("stat invoke"); try { $.ajax({ url: "//vstat.borderlessbd.com/stat/in", data: { ds: screen.width + "," + screen.height, ref: (document.referrer ? document.referrer : '') }, cache: false, dataType: "script" }); } catch (e) { console.log(e); } } } })();