Asynchronous programming in javascript -
i have load()
function, inside want call function download()
, download xml file. once download completed , have call function parsexml()
parses downloaded xml file. once parsing completed, have call function processparsedxmlfile()
. can please guide me how can achieve in simplest possible way ?
you can use callbacks
load(params , function(){ download(params, function(){ parsexml(params, function(){ processparsedxmlfile(params, function(){ ... }) }) }) })
Comments
Post a Comment