title: Uncaught ReferenceError: function not defined and it mark <DOCTYPE HTML>
body: <p>I need to submit form through ajax but function not defined and i browser inspect element mark <code>&lt;DOCOTYPE HTML&gt;</code> please find code below</p>
  
  <pre><code>&lt;form method="post" id="search_form" action="" name="search"&gt;
      &lt;div&gt;
          &lt;select name="car_id" id="car_id" class="form-control"&gt;
              &lt;option value="1"&gt;one&lt;/option&gt;
              &lt;option value="2"&gt;two&lt;/option&gt;
              &lt;option value="3"&gt;three&lt;/option&gt;
          &lt;/select&gt;
      &lt;/div&gt;
      &lt;div&gt;
          &lt;select name="km_id" id="km_id" class="form-control"&gt;
              &lt;option value="1"&gt;one&lt;/option&gt;
              &lt;option value="2"&gt;two&lt;/option&gt;
              &lt;option value="3"&gt;three&lt;/option&gt;
          &lt;/select&gt;
      &lt;/div&gt;
      &lt;div class="col-sm-12" align="center" style="font-size: 20px;padding-top: 50px;padding-bottom: 150px;"&gt;
          &lt;input class="btn-danger" id="search_button" name="search" onclick="search_function('locations.php')" type="button" value="search" /&gt;
      &lt;/div&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  &lt;div class="col-sm-1"&gt;&lt;/div&gt;
  &lt;div class="col-sm-12"&gt;
  &lt;/div&gt;
  &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script&gt;
  function search_function($responce) {
      $("#syana").innerHTML = '&lt;img align="center" style="width:100px;height: 100px;margin-right: 300px;" src="loading.gif" /&gt;';
      $.ajax({
          type: "POST",
          url: $responce,
          data: $("form").serialize(),
  
          success: function(data) {
              $("#search").html(data);
          },
          error: function() {
              alert("fix the PHP!")
          }
      });
  </code></pre>
  
  <p>note that same function used in another page and run successsfully</p>