I am attempting to reload the current page by passing parameters to javascript and calling location.href.
function setEventListener(item) {
item.addEventListener('click', function () {
let sortColumn = item.parentElement.getAttribute('data-sortColumn');
let sortOrder = item.getAttribute('data-sortOrder');
let controller = item.getAttribute('data-controller')
let hostName = window.location.hostname + ':' + window.location.port;
let url = new URL(hostName + controller + sortColumn + '/' + sortOrder + '/');
location.href = url.href;
}
The url is good, I can grab it from console output and paste in to the window and load the page fine. But this just calls the click function and does nothing.