Skip to content

Instantly share code, notes, and snippets.

@artlung
Created June 10, 2014 18:23
Show Gist options
  • Save artlung/cf549c7dcc3eefa80a9a to your computer and use it in GitHub Desktop.
Save artlung/cf549c7dcc3eefa80a9a to your computer and use it in GitHub Desktop.
(function () {
function r(r) {
try {
if (!window.location.ancestorOrigins) return;
for (var n = 0, t = window.location.ancestorOrigins.length; n < t; n++) {
r.call(null, window.location.ancestorOrigins[n], n)
}
} catch (o) {}
return []
}
function n(r) {
var n = [],
t;
do {
t = t ? t.parent : window;
try {
r.call(null, t, n)
} catch (o) {
n.push({})
}
} while (t != window.top);
return n
}
var t = n(function (r, n) {
n.push({
referrer: r.document.referrer || null,
location: r.location.href || null
})
});
r(function (r, n) {
t[n].ancestor = r
});
var o = '';
for (var e = t.length - 1; e >= 0; e--) {
o = t[e].location;
if (!o && e > 0) {
o = t[e - 1].referrer;
if (!o) {
o = t[e - 1].ancestor
}
}
if (o) {
break
}
}
o = encodeURIComponent(o);
var i = 'http://ib.adnxs.com/ttj?ttjb=1&bdref=' + o + '&id=2609544';
document.write('<script src="' + i + '"></' + 'script>')
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment