La funzione load puo' avere, come secondo argomento, una funzione di
callback, che viene eseguita al termine del caricamento della risorsa Esempio: <script> $(document).ready(function(){ $("button").click(function(){ $("#myDiv").load(“xyx.htm", function(responseTxt, statusTxt, xhr){ if(statusTxt == "success") alert(“Caricamento terminato"); if(statusTxt == "error") alert("Errore “ + xhr.status+":“ + xhr.statusText); }); }); }); </script> |