Simple AJAX post() function

phpThis is a simple post function of AJAX using jquery.

It will submit the data as POST to the specified php file and the data can then be worked normally as $_POST.

$("button").click(function(){
  $.post("submit_to.php",
  {
    name:"Nabtron",
    description:"technology"
  },
  function(data,status){
    alert("Data: " + data + "\nStatus: " + status);
  });
});

You can change the name from nabtron to anything. I hope you got an idea of how to make simple ajax post() function using jQuery!

 

 

hire best wordpress php css developer
Need Help? Hire me now!
I can help you in anything related to webdevelopment, including: HTML, CSS, PHP & MySql, WordPress (plugins & themes development, others), regular expressions, server management, etc.

Leave a Reply

Your email address will not be published.