Skip to content

Instantly share code, notes, and snippets.

@ivanrosolen
Created October 19, 2015 19:01
Show Gist options
  • Save ivanrosolen/05151a01a4d713da63e8 to your computer and use it in GitHub Desktop.
Save ivanrosolen/05151a01a4d713da63e8 to your computer and use it in GitHub Desktop.
Get URI var js
function getVar(name){
if(name=(new RegExp('[?&]'+encodeURIComponent(name)+'=([^&]*)')).exec(location.search))
return decodeURIComponent(name[1]);
}
var recoverHash = getVar('hash');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment