Node.js examples for String:URL String
Gets a param from the search part of a URL by name
/**/*from w ww . ja va2s . com*/ * Gets a param from the search part of a URL by name. * @param {string} param URL parameter to look for. * @return {string|undefined} undefined if the URL parameter does not exist. */ function getURLParameter(param) { if (!window.location.search) { return; } var m = new RegExp(param + '=([^&]*)').exec(window.location.search.substring(1)); if (!m) { return; } return decodeURIComponent(m[1]); }