2009-11-26 64 views
0

多回調代碼:

<script> 
    $(document).ready(function(){ 
     $.get("realisations.shtml",function(data){$('#realisations').empty().append(data)}); 
    }); 
</script> 

我需要執行$( 「toexpand」)隱藏(); beeing確認後的數據加載到DIV

這種嘗試不工作:

<script> 
    $(document).ready(function(){ 
     $.get("realisations.shtml",function(data){$('#realisations').empty().append(data)},function(){$(".toexpand").hide()}); 
    }); 
</script> 
+1

您不需要有多個回調,只需在單個回調中執行多個語句即可。 – tvanfosson 2009-11-26 14:36:44

回答

2
$(document).ready(function(){ 
    $.get("realisations.shtml",function(data) { 
     $('#realisations').empty().append(data); 
     $(".toexpand").hide(); 
    }) 
}); 
0
<script> 
$(document).ready(function(){ 
    $.get("realisations.shtml",function(data) { 
     $('#realisations').empty().append(data); 
     $(".toexpand").hide(); 
    }); 
}); 
</script> 
0

有沒有你不使用$一個原因()的load()?

$(document).ready(function(){ 
    $('#realisations').load("realisations.shtml", function() { 
     $(".toexpand").hide(); 
    }); 
});