javascript - Viewing multiple queries at once once they finish loading in php code igniter -
i using code igniter , in view have 3 methods call respective controller method loads data coming database. calling these methods @ once in seperate function. problem having methods show @ different times. there way can implement 3 functions show data @ same time once last function finishes loading? have
function function1() { $("#container1").load("/method1/"); } function function2() { $("#container2").load("/method2/"); } function function3() { $("#container3").load("/method3/"); }
and main function calls of 3 functions
function callall() { function1(); function2(); function3(); }
load
accepts completed callback. can hide elements, show them after callback called 3 times.
edit: code
$("#container1").load("/method1/", handlecompleted); // put handlecompleted in 3 completedcount = 0 function handlecompleted() { completedcount++; if(completedcount == 3) showall() }
Comments
Post a Comment