jQuery Tutorial


jQuery Example


jQuery References


jQuery Ajax get() Method Reference


  jQuery Ajax Method References


Uses

jQuery AJAX get() method request to Load URL document to open using GET.


Syntax

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

jQuery Ajax get() 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 get() method Example

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

  jQuery Ajax Method References