var a='http://site/activation.php?login=Alex&code=d3d9446802a44259755d38e6d16'; a=a.split(/(?:&code=)|=/); var login=a[1]; var Kod = a[2]; alert('login='+login+'\n\n'+'Kod='+ Kod);