Problem with jquery.ajax post while submitting form data

This is index.html

  <!doctype html>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="jsn.js">
</script>
</head>
<body>
<form >
FirstName:<input type="text" id="first" >
LastName:<input type="text" id="last" >
     <input type="Submit" value="not working">
</form>
<br>
<div id="display"></div>
</body>
</html>

and this is jsn.js

$(function(){
  $('form').submit(function(e){
    e.preventDefault();
   
    
    $.ajax({
      url: 'send.php',
      type: 'post',
      data: {'action': 'follow'},
      success: function(data, status) {
        if(data == "ok") {
          $('#display').html("<p>Saved!</p>");
          
        }
      },
      error: function(xhr, desc, err) {
        console.log(xhr);
        console.log("Details: " + desc + "\nError:" + err);
      }
    }); // end ajax call
  });

});

and this is send.php

<?php


if($_POST['action'] == "follow") {
 
  
  echo "ok";
}

?>

I’m testing it on firefox.
console.log is not giving the necessary info its only displays
“Use of getPreventDefault() is deprecated. Use defaultPrevented instead.”
other then that I want to how to submit form input values.
one more thing what is the AngularJs way to do this?

What does it say in your network tab send.php’s response?

Or is it ever getting there?

https://developer.mozilla.org/en-US/docs/Tools/Network_Monitor

https://mdn.mozillademos.org/files/7405/nm-overview.png
https://mdn.mozillademos.org/files/7393/nm-details-annotated.png

304 Not Modified

That doesn’t sound right to me.

Add this to your ajax:

cache: false

There’s a basic form example in the Angular docs, and there’s also a nice SitePoint article which goes into a little more detail.