how to redirect page in javascript with data code example
Example 1: 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'
}
Example 2: redirect with data jquery
$.redirect('demo.php', {'arg1': 'value1', 'arg2': 'value2'});