Advertisements
RSS

How to use asynchronous methods in AJAX

27 May

so this is a Java Script code that use synchronous ajaxpro Method

 var toReturn = MyAjaxClass.MyAjaxMethod(sVariable).value;

to change it to use Asynchronous method it would look like this:

MyAjaxClass.MyAjaxMethod(sVariable,MyAjaxMethodCallback);

MyAjaxMethodCallback is a Java Script function to handle the return value from the Ajax method, it could be like this

 
function MyAjaxMethodCallback(toReturn)
{
        alert(toReturn.value);
}

That’s it….

 

Advertisements
 
Leave a comment

Posted by on May 27, 2008 in General, Programming

 

Tags: , , , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

 
%d bloggers like this: