How AJAX Works In WordPress What's AJAX? AJAX stands for Asynchronous JavaScript And XML . It is the use of the XMLHttpRequest object to communicate with servers, which means it can communicate with the server, exchange data, and update the page without having to refresh the page. Step1: Define the Ajax URL. var ajaxurl = '<?php echo admin_url( 'admin-ajax.php' );?>'; Step2: Define its action and perform with using POST method var emailAddress = jQuery('#uemail').val(); var searchData = { action: 'get_registered_email', email_address:emailAddress, } Step 3: Perform ajax request jQuery.ajax({ url: ajaxurl, type: "POST", data: searchData, success: function(data){ jQuery("div#divLoading").removeClass('show'); jQuery('#memberResult').html(data); //alert(data); }, error: function(errorThrown){ alert(errorThrown); } }); Step 4: Use Wordpress 2 ajax hooks...
Coding Cheatsheets - Learn web development code and tutorials for Software developers which will helps you in project. Get help on JavaScript, PHP, XML, and more.