How to keep tab active when page is reloaded?
<p>When <code>Save</code> button is clicked page gets reloaded like so, with putting additional <code>parameter</code> in <code>url</code>:</p>

<pre><code>window.location.replace('https://www.servis-racunara.net/pages/users.php?new_column_added');
</code></pre>

<p>So, this is how I'm checking weather parameter is set within url:</p>

<pre><code>$(document).ready(function() {
    if (window.location.search.indexOf('new_column_added') &gt; -1) {}
});
</code></pre>

<p>So, page looks like this:<a href="https://i.stack.imgur.com/CbLPi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CbLPi.png" alt="enter image description here"></a></p>

<p>When there is <code>new_column_added</code> within url(i.e. when Save button is clicked), page should reload, but tab <code>Edit User List</code> should be active and his content should be there as well. This is how tabs are created using <code>Bootstrap</code>:</p>

<pre><code>&lt;ul id="mainTabs" class="nav nav-tabs  users-tabs" role="tablist"&gt;
   &lt;li id="glavniUseri" role="presentation" class="active"&gt;&lt;a href="#home" aria-controls="home" role="tab" data-toggle="tab"&gt;View Users&lt;/a&gt;&lt;/li&gt;
   &lt;li id="editUsers" role="presentation"&gt;&lt;a href="#edit-user-list" aria-controls="profile" role="tab" data-toggle="tab"&gt;Edit User List&lt;/a&gt;&lt;/li&gt;
   &lt;li role="presentation"&gt;&lt;a href="#messages" aria-controls="messages" role="tab" data-toggle="tab"&gt;Target Groups&lt;/a&gt;&lt;/li&gt;
   &lt;li role="presentation"&gt;&lt;a href="#settings" aria-controls="settings" role="tab" data-toggle="tab"&gt;API&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</code></pre>

<p>And this is how I managed to make <code>Edit User List</code> active:</p>

<pre><code>$(document).ready(function() {
    if (window.location.search.indexOf('new_column_added') &gt; -1) {
        console.log('radii ovoo');
        $('#glavniUseri').removeClass('active');
        $('#editUsers').addClass('active');
});
</code></pre>

<p>But all this does is to make <code>Edit User List</code> active, but content of <code>View Users</code> tab gets loaded, after the reload. I also tried doing this:</p>

<pre><code>$(document).on('load', function () {
            var $link = $('li.active a[data-toggle="tab"]');
            $link.parent().removeClass('active');
            var tabLink = $link.attr('href');
            $('#mainTabs a[href="' + tabLink + '"]').tab('show');
        });
</code></pre>

<p>But this is not working as well. I know similar questions have been asked before, but it seems like none of solutions fits my situation. So, if you have some idea, please help, I'm stuck with this. </p>