[jQuery] Reuse ajax calls
Hi !
Is there a way to store ajax calls in variables and reuse them later ?
I saw that $.ajax is returning the XHR object, maybe it could be a
lead ?
For example, I would like to do :
[code]
var SClass =
{
oSavedAjaxRequest: null,
doMyRequest: function()
{
if (SClass.oSavedAjaxRequest)
$.ajax(SClass.oSavedAjaxRequest);
else
SClass.oSavedAjaxRequest = $.ajax({url: 'test.php', type:
'POST', data: {}});
}
}
[/code]
Thank you !