function getVifKey(){ return '62cd4cff92cbf19ab2280d888e799cd5&uskey=d30947782f9a32043d0fd9333f2ede4c0'; } $('.my_down_href').click(function(){ if($(this).attr('href').indexOf('downxia.com')>-1 && $(this).attr('href').indexOf('?key=')<=-1 && $(this).attr('href') != 'javascript:;'){ $(this).attr('href',$(this).attr('href')+'?key=62cd4cff92cbf19ab2280d888e799cd5&uskey=d30947782f9a32043d0fd9333f2ede4c0'); $obj = $(this); setTimeout(function(){ $obj.attr('href',$obj.attr('href').split('?key')[0]) },100); } }); $('.dxDownAddress,.list-down li a').click(function(){ if($(this).attr('href').indexOf('downxia.com')>-1 && $(this).attr('href').indexOf('?key=')<=-1 && $(this).attr('href') != 'javascript:;'){ $(this).attr('href',$(this).attr('href')+'?key=62cd4cff92cbf19ab2280d888e799cd5&uskey=d30947782f9a32043d0fd9333f2ede4c0'); $obj = $(this); console.log($(this).attr('href')); setTimeout(function(){ $obj.attr('href',$obj.attr('href').split('?key')[0]) },100); } });