title: My jquery ajax code refresh the page without reason
body: <p>I have simple ajax-jquery/html/php code, but I get the problem when I click on button to add data, then page just refresh and nothing happend, also I cant see what is the problem becouse then my <code>success, error</code> into ajax dont work becouse page was refreshed...</p>
  
  <p>Here I have jquery / ajax code:</p>
  
  <pre><code> $( document ).ready(function() {
  $("#addCom").click(function() {
      var tabela = 'parcele';
          $.ajax({
              url: "insertKom.php",
              type: "POST",
              async: true, 
              data: { ajdi:ajdi, tabela:tabela,zakoga:$("#zakoga").val(),beleska:$("#beleska").val(),podsetnik:$("#podsetnik").val()},
              dataType: "html",
  
              success: function(data) {
                  console.log(data);  
              },
              error:function(data) {
              console.log(data); 
              }
          });
  
  });
   });
  </code></pre>
  
  <p>also HTML:</p>
  
  <pre><code> &lt;div class="jumbotron"&gt;
          &lt;form class="form-horizontal"&gt;
  &lt;fieldset&gt;
  
  
  &lt;!-- Text input--&gt;
  &lt;div class="form-group"&gt;
    &lt;label class="col-md-4 control-label" for="zakoga"&gt;Odnosi se na:&lt;/label&gt;  
    &lt;div class="col-md-4"&gt;
    &lt;input id="zakoga" name="zakoga" type="text" placeholder="" class="form-control input-md"&gt;
  
    &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;!-- Textarea --&gt;
  &lt;div class="form-group"&gt;
    &lt;label class="col-md-4 control-label" for="beleska"&gt;Beleska - komentar&lt;/label&gt;
    &lt;div class="col-md-4"&gt;                     
      &lt;textarea class="form-control" id="beleska" name="beleska"&gt;&lt;/textarea&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;!-- Text input--&gt;
  &lt;div class="form-group"&gt;
    &lt;label class="col-md-4 control-label" for="podsetnik"&gt;Podsetnik za dan:&lt;/label&gt;  
    &lt;div class="col-md-4"&gt;
  &lt;div class="input-append date" id="podsetnik" data-date="2014-05-05" data-date-format="yyyy-mm-dd"&gt;
    &lt;input class="span2 form-control" size="16" type="text" value=""&gt;
    &lt;span class="add-on"&gt;&lt;i class="icon-th"&gt;&lt;/i&gt;&lt;/span&gt;
  &lt;/div&gt;    
    &lt;/div&gt;
  &lt;/div&gt;
  
  
  &lt;!-- Button --&gt;
  &lt;div class="form-group"&gt;
    &lt;label class="col-md-4 control-label" for="addCom"&gt;&lt;/label&gt;
    &lt;div class="col-md-4"&gt;
      &lt;button id="addCom" name="addCom" class="btn btn-primary"&gt;Dodaj belesku&lt;/button&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;/fieldset&gt;
  &lt;/form&gt;
  
      &lt;/div&gt;
  </code></pre>
  
  <p>and PHP PDO - insert file:</p>
  
  <pre><code> try {        
                  $STH = $db-&gt;prepare("INSERT INTO zalihe (tabela, id_utabeli, datum, podsetnik, naslov, komentar, user_id) VALUES (:2,:1,:6,:3,:4,:5,:7)");
  
                  $STH-&gt;bindParam(':1', $_POST['ajdi']);
                  $STH-&gt;bindParam(':2', $_POST['tabela']);
                  $STH-&gt;bindParam(':3', $_POST['podsetnik']);
                  $STH-&gt;bindParam(':4', $_POST['zakoga']);
                  $STH-&gt;bindParam(':5', $_POST['beleska']);
                  $STH-&gt;bindParam(':6', now());
                  $STH-&gt;bindParam(':7', $user_id);
  
                  $STH-&gt;execute();
  
              } catch (PDOException $e) {
                  echo $e-&gt;getMessage();
              }
              echo "&lt;p&gt;Data submitted successfully&lt;/p&gt;";
  </code></pre>
  
  <p>But when I click on button with ID=addCom then page just refresh and nothing add to database. What can be the reason?</p>