Question
JQuery ajax call vs pega.u.d.asyncRequest()
Hi,
I have a requirement for a custom control (a genuine 'custom' req). The control much run an activity in pega asynchronously.
Point is: both pega.u.d.asyncRequest() and $.ajax (Jquery ajax call) work, meaning I am able to run an activity asynchronously. But I want to understand what is the benefit of using pega.u.d.asyncRequest() over $.ajax? BTW Jquery 'context' does not work with pega.u.d.asyncRequest(). Are there any longer term issues if I use $.ajax?
***Updated by moderator: Lochan to update Categories***
Hi ,
The difference comes in terms of the namespacing . When you are using the pega.u.d.asyncRequest method we are sure that the pega objext is initialized and suppose if some one/application the $ajax has been overirdden then you may face the issue.
Aslo in terms of handling the sucess function, pega looks in a polling way , supoose there is more time in the network call then the busy indicator wil be dislplayed or the network erors will be handled , if you are using your ownn function then you need to take care of all the server reponses like 404 /500 etc.
Hope this is helpful.