Skip to main content

Posts

Showing posts with the label jQuery Ajax

Jquery Ajax method

AJAX = Asynchronous JavaScript and XML. AJAX is about loading data in the background and display it on the webpage, without reloading the whole page. The ajax() method is used to perform an AJAX (asynchronous HTTP) request. Notes: Asynchronous means that the script will send a request to the server, and continue it's execution without waiting for the reply. As soon as reply is received a browser event is fired, which in turn allows the script to execute associated actions. The serialize() method creates a URL encoded text string by serializing form values readyState  Holds the status of the XMLHttpRequest. Changes from 0 to 4: 0: request not initialized 1: server connection established 2: request received 3: processing request 4: request finished and response is ready The parameters specifies: beforeSend(xhr): A function to run before the request is sent eg: beforeSend: function() {     xhr.setRequestHeader("Accept", "text/javascr...

JSON Jquery Ajax

If use want to trigger ajax on Click   $('.taskStat').live('click',function(){        $.ajax({             type: 'POST',             url: ajax_url+"Members/change_Addtask/"+stat,             success: function(data) {                 var obj=JSON.parse(data);                 if(obj.resp=='true')                 {                     alert("Hello sudhir");                 } else                 {          ...