jQuery Tutorial


jQuery Example


jQuery References


jQuery Ajax post() Method Reference


  jQuery Ajax Method References


Uses

jQuery AJAX post() method Load URL for requested document to open using POST.


Syntax

$.post( url,[data],[callback],[type] )

jQuery Ajax post() Method support following parameter.

Parameter Description
url url is required parameter. String containing the URL to which the request is sent.
data data is optional parameter. data represent to the server when request was found. .
callback Callback is optional parameter. It is use to represents a function to be executed whenever effect is completed.
type type is optional parameter.type represent data returned (like html,xml,js etc.).
External File Create
(name.php)
Write Down following code in name.php file.
<?php
if( $_REQUEST["name"] )
{
   $name = $_REQUEST['name'];
   echo "Welcome ". $name;
}
?>

jQuery Ajax post() method Example

<script type="text/javascript"> 
$(document).ready(function(){
  $("button").click(function(){
    $.post("name.php",{name:"Jay"},function(data){
       $('#msg').html(data);}
       );
    });
  }
);
<script>
Online Try This Code Your Self....   »

  jQuery Ajax Method References