title: how to popup after ajax "success:"
body: <p>i have a button, when i clicks this button it will goes to  ajax. In the suceess condition,it returns three values for 'data' which are 1,2,3. i want to popup a login form only when data=1.(if the user is not logged in). pls help me.</p>
  
  <pre><code> &lt;button data-toggle="modal" data-target="#xmpModal" class="btn green btn-success" onclick="get('&lt;?echo $u_id;?&gt;','&lt;?echo $e_id;?&gt;')"&gt;click&lt;/button&gt;
  </code></pre>
  
  <p><strong>popup div</strong></p>
  
  <pre><code>   &lt;div class="modal fade" id="exmpModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel" aria-hidden="true"&gt;
                &lt;div class="modal-dialog"&gt;
                  &lt;div class="modal-content"&gt;
                      &lt;div class="modal-header"&gt;
                          &lt;button type="button" class="close" data-dismiss="modal"&gt;&lt;span aria-hidden="true"&gt;Ã—&lt;/span&gt;&lt;span class="sr-only"&gt;Close&lt;/span&gt;&lt;/button&gt;
                          &lt;h3 class="modal-title" id="lineModalLabel"&gt;My Modal&lt;/h3&gt;
                      &lt;/div&gt;
                      &lt;div class="modal-body"&gt;
  
                          &lt;!-- content goes here --&gt;
                          &lt;form&gt;
                            &lt;div class="form-group"&gt;
                              &lt;label for="exampleInputEmail1"&gt;Email address&lt;/label&gt;
                              &lt;input type="email" class="form-control" id="exampleInputEmail1" placeholder="Enter email"&gt;
                          &lt;/div&gt;
                          &lt;div class="form-group"&gt;
                              &lt;label for="exampleInputPassword1"&gt;Password&lt;/label&gt;
                              &lt;input type="password" class="form-control" id="exampleInputPassword1" placeholder="Password"&gt;
                          &lt;/div&gt;
  
                        &lt;button type="submit" class="btn btn-default"&gt;Submit&lt;/button&gt;
                    &lt;/form&gt;
  
                &lt;/div&gt;
                &lt;div class="modal-footer"&gt;
                  &lt;div class="btn-group btn-group-justified" role="group" aria-label="group button"&gt;
                      &lt;div class="btn-group" role="group"&gt;
                          &lt;button type="button" class="btn btn-default" data-dismiss="modal"  role="button"&gt;Close&lt;/button&gt;
                      &lt;/div&gt;
                      &lt;div class="btn-group btn-delete hidden" role="group"&gt;
                          &lt;button type="button" id="delImage" class="btn btn-default btn-hover-red" data-dismiss="modal"  role="button"&gt;Delete&lt;/button&gt;
                      &lt;/div&gt;
                      &lt;div class="btn-group" role="group"&gt;
                          &lt;button type="button" id="saveImage" class="btn btn-default btn-hover-green" data-action="save" role="button"&gt;Save&lt;/button&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>ajax</strong></p>
  
  <pre><code>  function get(u_id,e_id)
  {
      $.ajax({
  
          url: "&lt;?echo base_url()?&gt;events/xyz",
          type: 'post',   // HTTP METHOD
          data: 
          {u_id:u_id,e_id:e_id  },
  
  
          success: function(data)
          {  
  
               //alert(data);  
              if(data==1) 
              {
                  // add your code pls
              }                                    
             else if(data==2)
  
             {
                  alert("hai");
  
             }
             else if(data==3)   
             {
               alert("hello"); 
             }        
          }
  
        });
    }
  </code></pre>
  
  <p><strong>my function in php controller</strong></p>
  
  <pre><code>    public function xyz()
  {      
      $u_id=$this-&gt;input-&gt;post('u_id');
      $e_id=$this-&gt;input-&gt;post('e_id');        
      $temp=$this-&gt;session-&gt;userdata('user');
      $g=$this-&gt;xm-&gt;is_going($u_id,$e_id);
      $g1=$this-&gt;xm-&gt;is_going1($u_id,$e_id);
      if($temp=="")
      {          
         $d=1;
         echo $d;
  
      }
      else if($g==$u_id)
          {
  
             $d=2;
             echo $d;
  
          }
          else if($g1==$u_id)
              {
  
                  $d=3;
                  echo $d;
                  $this-&gt;xm-&gt;event_updation($e_id,$u_id);
              }
              else
              {           
                  $data=array('event_id'=&gt;$e_id,'ev_going'=&gt;$u_id);             
                  $this-&gt;xm-&gt;eventgoing($data);          
       }
     } 
  </code></pre>