title: Ajax not displaying content
body: <p>So i have part where AJAX updates cart on click. Every AJAX call on my website is working fine except this one where call is processed but it just clears part of the page that should've been updated. So on both buttons click after <code>&lt;tbody id="korpin"&gt;</code> everything is cleared until next div.</p>
  
  <p><strong>Cart.php</strong></p>
  
  <pre><code>&lt;tbody id="korpin"&gt;
  
  &lt;?php 
  $conn = new mysqli("localhost", "root", "", "pc") or die("Unable to connect");
      foreach($_SESSION['korpica'] as $id =&gt; $korpa):
  $sql = $conn-&gt;prepare("SELECT a.sifra,a.slika,a.imeProizvoda,a.brend,b.cijena,b.cijena2 FROM proizvodi a inner join stanje b on a.sifra = b.sifra WHERE a.sifra = '".$korpa."'");
  
              if($sql-&gt;execute()){
              $sql-&gt;bind_result($sifra,$slika,$imeProizvoda,$brend,$cijena,$cijena2);
              $sql-&gt;store_result();
              while($sql-&gt;fetch()){
              ?&gt;
                    &lt;tr&gt;
                      &lt;td class="text-center"&gt;&lt;a href="product.php?category=&lt;?php echo $sifra; ?&gt;"&gt;&lt;img width="70px" src="image/proizvodi/&lt;?php echo $slika; ?&gt;.jpg" alt="&lt;?php echo $imeProizvoda; ?&gt;" title="&lt;?php echo $imeProizvoda; ?&gt;" class="img-thumbnail" /&gt;&lt;/a&gt;&lt;/td&gt;
                      &lt;td class="text-left"&gt;&lt;a href="product.php?category=&lt;?php echo $sifra; ?&gt;"&gt;&lt;?php echo $imeProizvoda; ?&gt;&lt;/a&gt;&lt;br /&gt;
                       &lt;/td&gt;
                      &lt;td class="text-left"&gt;&lt;?php echo $brend; ?&gt;&lt;/td&gt;
                      &lt;td class="text-left" width="200px"&gt;&lt;div class="input-group btn-block quantity"&gt;
  
   &lt;span class="input-group-btn"&gt;
  &lt;button type="button" data-toggle="tooltip" title="+1" class="btn btn-primary" onclick="dodaj(`&lt;?php echo $sifra; ?&gt;`); cart.add(`&lt;?php echo(str_replace('"', '\\`', $imeProizvoda)); ?&gt;`); refresh(`&lt;?php echo $sifra; ?&gt;`);"&gt;&lt;i class="fa fa-clone"&gt;&lt;/i&gt;&lt;/button&gt;
   &lt;button type="button" data-toggle="tooltip" title="Ukloni" class="btn btn-danger" onclick="ukloni(`&lt;?php echo $sifra; ?&gt;`); sd.remove(`&lt;?php echo(str_replace('"', '\\`', $imeProizvoda)); ?&gt;`); refresh(`&lt;?php echo $sifra; ?&gt;`);"&gt;&lt;i class="fa fa-times-circle"&gt;&lt;/i&gt;&lt;/button&gt;
  &lt;/span&gt;&lt;/div&gt;&lt;/td&gt;
   &lt;?php if ($cijena2 &gt; 0): ?&gt;
   &lt;td class="text-right"&gt;€&lt;?php echo bcdiv($cijena2,1,2); ?&gt;&lt;/td&gt;
  &lt;td class="text-right"&gt;€&lt;?php echo bcdiv($cijena2,1,2); ?&gt;&lt;/td&gt;
  &lt;?php else :?&gt;
  &lt;td class="text-right"&gt;€&lt;?php echo bcdiv($cijena,1,2); ?&gt;&lt;/td&gt;
  &lt;td class="text-right"&gt;€&lt;?php echo bcdiv($cijena,1,2); ?&gt;&lt;/td&gt;
  &lt;span class="price-old"&gt;&lt;/span&gt;
   &lt;?php endif ?&gt;
   &lt;/tr&gt; 
   &lt;?php 
  }$sql-&gt;free_result();
  } endforeach;
  
  $conn-&gt;close(); 
  ?&gt;
  
  &lt;/tbody&gt;
  </code></pre>
  
  <p><strong>korpinUpd.js</strong></p>
  
  <pre><code>function refresh(sifra) {
      $.ajax({
          url: 'cartUpdate.php',
          success : function(data) {
          $('#korpin').html(data);
                  }
  
      });
  }
  </code></pre>
  
  <p>and finally <strong>cartUpdate.php</strong></p>
  
  <pre><code>  &lt;?php 
      session_start();
      $output ='';
                 $cena;                               $conn = new mysqli("localhost", "root", "", "pc") or die("Unable to connect");
   foreach($_SESSION['korpica'] as $id =&gt; $korpa){
  $sql = $conn-&gt;prepare("SELECT a.sifra,a.slika,a.imeProizvoda,a.brend,b.cijena,b.cijena2 FROM proizvodi a inner join stanje b on a.sifra = b.sifra WHERE a.sifra = '".$korpa."'");
  
  if($sql-&gt;execute()){
  $sql-&gt;bind_result($sifra,$slika,$imeProizvoda,$brend,$cijena,$cijena2);
   $sql-&gt;store_result();
  while($sql-&gt;fetch()){
  
  $output.= '&lt;tr&gt;';
  $output.='&lt;td class="text-center"&gt;&lt;a href="product.php?category='.$sifra.'"&gt;&lt;img width="70px" src="image/proizvodi/'.$slika.'.jpg" alt="'.$imeProizvoda.'" title="'.$imeProizvoda.'" class="img-thumbnail" /&gt;&lt;/a&gt;&lt;/td&gt;
  &lt;td class="text-left"&gt;&lt;a href="product.php?category='.$sifra.'"&gt;'.$imeProizvoda.'&lt;/a&gt;&lt;br /&gt;
   &lt;/td&gt;
   &lt;td class="text-left"&gt;'.$brend.'&lt;/td&gt;
   &lt;td class="text-left" width="200px"&gt;&lt;div class="input-group btn-block quantity"&gt;
   &lt;span class="input-group-btn"&gt;
  &lt;button type="button" data-toggle="tooltip" title="+1" class="btn btn-primary" onclick="dodaj(`'.$sifra.'`); cart.add(`'.(str_replace('"', '\\`', $imeProizvoda)).'`); refresh(`'.$sifra.'`);"&gt;&lt;i class="fa fa-clone"&gt;&lt;/i&gt;&lt;/button&gt;
   &lt;button type="button" data-toggle="tooltip" title="Ukloni" class="btn btn-danger" onclick="ukloni(`'.$sifra.'`); sd.remove(`'.(str_replace('"', '\\`', $imeProizvoda)).'`); refresh(`'.$sifra.'`);"&gt;&lt;i class="fa fa-times-circle"&gt;&lt;/i&gt;&lt;/button&gt;
  &lt;/span&gt;&lt;/div&gt;&lt;/td&gt;';
   if ($cijena2 &gt; 0){
  $cena = $cijena2;
  }else{
   $cena = $cijena;
    }
    $output .=  '&lt;td class="text-right"&gt;€'.$cena.'&lt;/td&gt;
          &lt;td class="text-right"&gt;€'.$cena.'&lt;/td&gt;';
  
  $output .= '&lt;/tr&gt;';
    }
    }}
  
          $conn-&gt;close();                    
      echo $output;
  
      ?&gt;
  </code></pre>