This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// GA 统计 | |
var trackEvent = function (opt) { | |
if (typeof ga !== 'undefined' && ga) { | |
var _act, _cat, _lbl, _val; | |
if (opt) { | |
_cat = opt.category || ''; | |
_act = opt.action || ''; | |
_lbl = opt.label || ''; | |
_val = opt.value || 0; | |
return ga('send', 'event', _cat, _act, _lbl, _val); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var parser = function(url) { | |
var a = document.createElement('a'); | |
a.href = url; | |
var search = function(search) { | |
if(!search) return {}; | |
var ret = {}; | |
search = search.slice(1).split('&'); | |
for(var i = 0, arr; i < search.length; i++) { |