Mohd Malaka Weblog

About anything….

  • Welcome


    Welcome to my Weblog. Here I post about anything, mainly about programming. Enjoy

  • Archives

  • Flickr Photos

    Dublin

    Dublin



    Garda

    Twins

    More Photos
  •  

    May 2008
    M T W T F S S
        Jun »
     1234
    567891011
    12131415161718
    19202122232425
    262728293031  
  • free counters

Archive for May 27th, 2008

How to use asynchronous methods in AJAX

Posted by malakablog on May 27, 2008

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….

 

Posted in Uncategorized | Tagged: , , , , , | Leave a Comment »