redirect with url parameters js code example
Example: javascript redirect with extra url arguments
if (window.location.search === '') {
window.location = window.location.origin + '?arg=1'
} else {
window.location = window.location.origin + window.location.search + '&arg=1'
}