dev work
This commit is contained in:
parent
6e7977997e
commit
bfb241c3eb
19 changed files with 284 additions and 181 deletions
|
|
@ -164,7 +164,7 @@
|
|||
if (data.p === null)
|
||||
// null from user callback.
|
||||
return;
|
||||
data.rnd = Math.random().toString(36).substr(2, 5); // Browsers don't always listen to Cache-Control.
|
||||
data.rnd = Math.random().toString(36).slice(2, 5); // Browsers don't always listen to Cache-Control.
|
||||
|
||||
var endpoint = get_endpoint();
|
||||
if (!endpoint) return warn("no endpoint found");
|
||||
|
|
@ -202,10 +202,10 @@
|
|||
|
||||
// Get a query parameter.
|
||||
window.goatcounter.get_query = function (name) {
|
||||
var s = location.search.substr(1).split("&");
|
||||
var s = location.search.slice(1).split("&");
|
||||
for (var i = 0; i < s.length; i++)
|
||||
if (s[i].toLowerCase().indexOf(name.toLowerCase() + "=") === 0)
|
||||
return s[i].substr(name.length + 1);
|
||||
return s[i].slice(name.length + 1);
|
||||
};
|
||||
|
||||
// Track click events.
|
||||
|
|
@ -308,7 +308,7 @@
|
|||
)
|
||||
goatcounter.count();
|
||||
else {
|
||||
var f = function (e) {
|
||||
var f = function () {
|
||||
if (document.visibilityState !== "visible") return;
|
||||
document.removeEventListener("visibilitychange", f);
|
||||
goatcounter.count();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue