Problem with jquery.ajax post while submitting form data

This is index.html

  <!doctype html>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script src="//"></script>
<script src="jsn.js">
<form >
FirstName:<input type="text" id="first" >
LastName:<input type="text" id="last" >
     <input type="Submit" value="not working">
<div id="display"></div>

and this is jsn.js

      url: 'send.php',
      type: 'post',
      data: {'action': 'follow'},
      success: function(data, status) {
        if(data == "ok") {
      error: function(xhr, desc, err) {
        console.log("Details: " + desc + "\nError:" + err);
    }); // end ajax call


and this is send.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?

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.