I have a few jQuery.load Requests. But I only want to show the results if all loads are successfull and are ready.
I found "queue" but I'm not sure weather this is the right. http://api.jquery.com/queue/
Does anyone know more than I ?
I tried this now, it doesn't works.
function ShowInfos(Code)
{
$.when( asyncLoadInfos(Code) ).then(
function( status ) {
alert( status + ", things are going well" );
},
function( status ) {
alert( status + ", you fail this time" );
},
function( status ) {
//Infos einblenden
ShowGrid();
alert(status + "Yeah");
}
);
}
function asyncLoadInfos(Code)
{
var dfd = new jQuery.Deferred();
//Generelle Infos laden
$('someDiv').load(customerURI, function()
{
//Here is some Action, not relevant fot the topic
});
$("anootherDiv").load(todoURI, function()
{
//Unrelevant Code, too
});
$("abc").load(phoneNoteURI, function()
{
});
return dfd.promise();
}