Showing posts with label Javascript. Show all posts
Showing posts with label Javascript. Show all posts

Wednesday, March 04, 2015

Simple jQuery Ajax Post Sending

Sending POST data to server using jQuery is very simple. I assumed that you sending POST data when the DIV with id:#sendme is clicked. So, you can use codes like this:

$("#sendme").click(function(){

 $.post("URL POST",
    {
        param1: "value1",
        param2: "value2"
    },
    function(data, status){

    });

});



- URL POST can be replaced with your URL post
- param1 and param2 are name of post data
- value1 and value2 are value of param that will be sent to URL POST