title: Before open bootstrap modal redirect to another page
body: <p>I have one button in which i have put below code : </p>
  
  <pre><code>&lt;a href="#thread_add_modal" class="btn btn-primary" id="thread_add_id" data-toggle="modal"&gt;New Thread&lt;/a&gt;
  </code></pre>
  
  <p>Any person is able to create thread once they logged in.Without logged in i cant allow user to create thread.</p>
  
  <p>Javascript :</p>
  
  <pre><code>$("#thread_add_id").click(function(){
           var login = "&lt;?php echo $this-&gt;session-&gt;userdata('login')?&gt;";
           if(login == false){
               window.location.href = "&lt;?php echo base_url()?&gt;login/";
           }
  
  
       });
  </code></pre>
  
  <p>Problem :</p>
  
  <p>When i am trying to click on New thread without login that time its first open popup and then redirect to login page.<br/>
   I dont want to show that popup before logged in.</p>
  
  <p>For that purpose i have done like above.But its not working properly for me.
  so any idea, any suggestions.</p>