From 9d7e6c962a36d5674bc898761c6c6408cf788764 Mon Sep 17 00:00:00 2001 From: Milan Lesichkov Date: Mon, 29 Jul 2019 19:50:29 +0100 Subject: [PATCH] Update initialize.js --- initialize.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/initialize.js b/initialize.js index f1abd3b..15215a3 100644 --- a/initialize.js +++ b/initialize.js @@ -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;