0
私は別のページにボタンがあり、ユーザーがそれをクリックすると、別のページにリダイレクトして、アクティブなクラスをwindow.location.hashのタブに追加する必要があります。しかし、それは動作しません。そのページにリダイレクトされます。何が間違っているのですか?Jqueryは別のページからタブをアクティブにします
HTML:
/* JQUERY */
$("#butonmesaj").on('click', function(){
window.location.href = "{% url 'userena_profile_detail' user%}#messages";
var id = window.location.hash;
$(id).addClass('active');
});
<div role="tabpanel" class="tab-pane" id="messages">
<div class="embed-responsive embed-responsive-16by9" style="height: 500px;">
<iframe class="embed-responsive-item" src="{% url 'userena_umessages_list' %}"></iframe>
</div>