prefix url with http.

This commit is contained in:
Stefan Midjich 2016-12-13 14:52:11 +01:00
parent a91f1775fb
commit ea51951696
1 changed files with 5 additions and 0 deletions

View File

@ -25,6 +25,11 @@ var getUrlParameter = function getUrlParameter(sParam) {
function do_success() {
var url = getUrlParameter('url');
// If url does not start with http the window.location redirect
// won't work. So prefix http to url.
if (!url.startsWith('http')) {
url = 'http://'+url;
}
console.log('success: '+url);
// Do something like refresh the window or go to another URL.