Skip to content

Commit

Permalink
Update initialize.js
Browse files Browse the repository at this point in the history
  • Loading branch information
lesichkovm authored Jul 29, 2019
1 parent 0542b18 commit 9d7e6c9
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions initialize.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,13 +312,14 @@ function Initialize() {
} else {
var url = rtrim(Config.getRootUrl(), ['/']) + '/' + ltrim(url, ['/']);
}
var queryString = Object.keys(data).map((key) => {
return encodeURIComponent(key) + '=' + encodeURIComponent(data[key])

var queryString = (typeof data === 'undefined') ? '' : Object.keys(data).map((key) => {
return encodeURIComponent(key) + '=' + encodeURIComponent(data[key])
}).join('&');

if (queryString.length > 0) {
url = url + '?' + queryString;
}
url = url + (url.indexOf('?') <0 ? '?' : '&') + queryString;
}

window.location.href = url;

Expand Down

0 comments on commit 9d7e6c9

Please sign in to comment.