title: My ajax request response hangs my firefox browser?
body: <p>I created dependable dropdown for country state and city using ajax in php. 
  If I run it in Chrome or Opera it's working, but if I run it in Firefox the browser hangs</p>
  
  <pre class="lang-js prettyprint-override"><code>$(document).ready(function(){
    $('#country').on('change',function(){
        var country_id=$(this).val();
        $.ajax({
              type:'POST',
              url:'ajax/get_state.php',
              data:{country_id:country_id},
              success:function(data){
                $('#state').html(data);
              },
              error:function(){
  
              }
          });
        });
  
    $('#state').on('change',function(){
    var state_id=$(this).val();
    $.ajax({
        type:'POST',
        url:'ajax/get_city.php',
        data:{state_id:state_id},
        success:function(data){
              $('#city').html(data);
            },
            error:function(){
  
            }
        });
      });
  });
  </code></pre>
  
  <p>here is get_state.php :- </p>
  
  <pre><code>&lt;?php
  
  include '../config.php';
  if(isset($_POST['country_id'])){
    $sql = mysqli_query($db_connect,"SELECT * FROM states where country_id = '".$_POST['country_id']."'") or die(mysqli_error($db_connect));
  
  ?&gt;
  &lt;option value="0"&gt;Select State&lt;/option&gt;
  &lt;?php
  while($row = mysqli_fetch_array($sql)){
  
  echo "&lt;option value=".$row['id']."&gt;".$row['name']."&lt;/option&gt;";
  
  }
  
  }
  
  ?&gt;
  </code></pre>
  
  <p>and here is get_city.php :- </p>
  
  <pre><code>&lt;?php
  
  include '../config.php';
  if(isset($_POST['state_id'])){
  
  $sql = mysqli_query($db_connect,"SELECT * FROM cities where state_id = '".$_POST['state_id']."'") or die(mysqli_error($db_connect));
  
  ?&gt;
  &lt;option value="0"&gt;Select City&lt;/option&gt;
  &lt;?php
  while($row = mysqli_fetch_array($sql)){
  
  echo "&lt;option value=".$row['id']."&gt;".$row['name']."&lt;/option&gt;";
  
  }
  
  }
  
  ?&gt;
  </code></pre>
  
  <p>here is my ajax and all ajax php code.  This code working fine in other browser but if i run in Firefox so Firefox hang.</p>