Skip to content

Instantly share code, notes, and snippets.

@nczz
Created June 11, 2019 09:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nczz/fa4180399298129ac3df9a3a544db27c to your computer and use it in GitHub Desktop.
Save nczz/fa4180399298129ac3df9a3a544db27c to your computer and use it in GitHub Desktop.
從 Cloudflare 的 API 拿取瀏覽者的瀏覽細節
jQuery.get('https://www.mxp.tw/cdn-cgi/trace', function(r) {
r = r.split('\n'), a = [];
for (var i = 0; i < r.length; ++i) a[r[i].split('=')[0]] = r[i].split('=')[1];
console.log(a['loc']);
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment