Created
May 31, 2018 18:27
-
-
Save SalesforceBobLightning/6fe1a7fbbfd95984c34223d84a3a6044 to your computer and use it in GitHub Desktop.
Salesforce Lightning Get Query String Parameter JavaScript Helper Method
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
getQueryStringParameter : function(name) { | |
var url = decodeURIComponent(window.location.search.substring(1)); | |
var params = url.split('&'); | |
for (var i = 0; i < params.length; i++) { | |
var p = params[i].split('='); | |
if (p[0] === name) { | |
return p[1] === undefined ? true : p[1]; | |
} | |
} | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment