title: Ajax : function is not working
body: <p>I don't know why my code does not work onclick, but there is no pop up. The AJAX function var <code>phone</code> and <code>id</code> got data, but the AJAX did not. Is there anything wrong with the script? Does the AJAX need a jQuery library?</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/core.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
    function clickButton() {
      var phone = document.getElementById('phone').value;
      var id = document.getElementById('id').value;
      $.ajax({
        type: "post",
        url: "userDetaiAjax.php",
        data: {
          'phone': phone,
          'id': id
        },
        cache: false,
        success: function(html) {
          alert('Data Send');
          $('#msg').html(html);
        }
      });
      return false;
    }
  &lt;/script&gt;
  &lt;div class="col"&gt;
    &lt;div class="form-group"&gt;
        &lt;h6&gt;
          &lt;label&gt;Name :&lt;/label&gt;
          &lt;?php echo $name ?&gt;
        &lt;/h6&gt;
        &lt;h6&gt;
          &lt;label&gt;Email :&lt;/label&gt;
          &lt;?php echo $email ?&gt;
        &lt;/h6&gt;
        &lt;input type="" name="phone" id="phone"&gt;
        &lt;input type="" name="id" id="id" value="&lt;?php echo $_SESSION[" staff_id "];?&gt;" hidden&gt;
        &lt;h6&gt;
          &lt;label&gt;Phone :&lt;/label&gt;
          &lt;?php echo $phone ?&gt;
        &lt;/h6&gt;
        &lt;input type="submit" name="aa" value="submit2" onclick="return clickButton();"&gt;
      &lt;/form&gt;
      &lt;p id="msg"&gt;&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>for the url</p>
  
  <pre><code>&lt;?php 
  $phone = $_POST['phone'];
  $id = $_POST['id'];
  echo 'success';
  echo $phone;
  echo $id;
  
  $a='"USR_ID"';
  $b='"phone"';
  include 'conn.php';
  if (!$conn) {
      $e = oci_error();
      trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
  
  }
  
     $query = "update usr_web SET phone=:c1 WHERE usr_id=:c2";
  
                $stid = oci_parse($conn, $query);
  
     oci_bind_by_name($stid, ":c1", $phone);
     oci_bind_by_name($stid, ":c2", $id);
  
  
                                   $result = oci_execute($stid);
                                   oci_free_statement($stid);
                                   oci_commit($conn);
                                    oci_close($conn);
                              echo $result;
  
  ?&gt;
  </code></pre>