Thursday 5 June 2014

Jquery $.ajax method

-Here is the sample code for $.ajax calling method in php

var id = $('#someinput_id').val();
$.ajax({
 url: admin_url,
 type: 'POST', 
 dataType: 'html', 
 data: { 
id: id,
name: 'Ravichandran',
date: "<?php echo date('d-m-Y', strtotime(now())) ?>", 

 },
 success:function( data ){  
 $('#some_id').html(data); 
 }
 });

No comments:

Post a Comment