Created
April 25, 2014 01:02
-
-
Save maxicecilia/11274715 to your computer and use it in GitHub Desktop.
Simple method to recover parameter values from a URL
This file contains hidden or 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
$.urlParam = function(href, name){ | |
var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(href); | |
return results[1] || 0; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment