mirror of
https://codeberg.org/prof_x_pvt_ltd/captive.whump.shanti-portal
synced 2024-08-14 22:46:42 +00:00
redirect to url parameter.
This commit is contained in:
parent
14f7302f7c
commit
16efbc89c0
1 changed files with 18 additions and 1 deletions
|
@ -5,13 +5,30 @@
|
||||||
|
|
||||||
var debug = true;
|
var debug = true;
|
||||||
|
|
||||||
|
var getUrlParameter = function getUrlParameter(sParam) {
|
||||||
|
var sPageURL = decodeURIComponent(window.location.search.substring(1)),
|
||||||
|
sURLVariables = sPageURL.split('&'),
|
||||||
|
sParameterName,
|
||||||
|
i;
|
||||||
|
|
||||||
|
for (i = 0; i < sURLVariables.length; i++) {
|
||||||
|
sParameterName = sURLVariables[i].split('=');
|
||||||
|
|
||||||
|
if (sParameterName[0] === sParam) {
|
||||||
|
return sParameterName[1] === undefined ? true : sParameterName[1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// This function ensures the user gets redirect to the correct destination once
|
// This function ensures the user gets redirect to the correct destination once
|
||||||
// all jobs have succeeded in the portal software.
|
// all jobs have succeeded in the portal software.
|
||||||
function do_success() {
|
function do_success() {
|
||||||
console.log('success: '+window.location);
|
console.log('success: '+window.location);
|
||||||
|
|
||||||
|
var url = getUrlParameter('url');
|
||||||
|
|
||||||
// Do something like refresh the window or go to another URL.
|
// Do something like refresh the window or go to another URL.
|
||||||
window.location = window.href;
|
window.location = url;
|
||||||
location.reload(true);
|
location.reload(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue