16 lines
405 B
JavaScript
16 lines
405 B
JavaScript
jfa.utilities.routing = (function () {
|
|
function getCurrentURL() {
|
|
return new URL(window.location.origin + window.location.pathname);
|
|
}
|
|
|
|
function getCurrentURLWithHandler(handler) {
|
|
let url = getCurrentURL();
|
|
url.searchParams.append("handler", handler);
|
|
return url;
|
|
}
|
|
|
|
return {
|
|
getCurrentURL: getCurrentURL,
|
|
getCurrentURLWithHandler: getCurrentURLWithHandler
|
|
};
|
|
})(); |