Return '' instead of 'null'

This commit changes the behavior of getURLParameter(name) to return an
empty string when the parameter is not set or has empty value. Before it
returned 'null' as string.
This commit is contained in:
Simon Eisenmann 2016-09-16 15:48:28 +02:00
parent fcc91cbc49
commit 1e9d523046
1 changed files with 1 additions and 1 deletions

View File

@ -1723,7 +1723,7 @@ function formatDate(timestamp){
*/
function getURLParameter(name) {
return decodeURI(
(RegExp(name + '=' + '(.+?)(&|$)').exec(location.search) || [, null])[1]
(RegExp(name + '=' + '(.+?)(&|$)').exec(location.search) || [, ''])[1]
);
}