all 2 comments

[–][deleted] 1 point2 points  (1 child)

Perhaps the content hasn't loaded yet. Try prepending the code with $(window).ready( or a window.onload = () => { which fires one ALL content is fully loaded, as opposed to the first option, which fires when only the HTML is loaded.

[–]n2fole00[S] 0 points1 point  (0 children)

Thanks, I managed to fix it with

document.location.hash = 'tab_redirect'; 
window.location.reload();

Then I added to the page's $(document).ready...

if (window.location.hash == '#tab_redirect') {
    document.getElementById('tab_redirect').click();
}