开发者

Multiple callback on $.get

开发者 https://www.devze.com 2022-12-12 09:33 出处:网络
here is the code : <script> $(document).ready(function(){ $.get(\"realisations.shtml\",function(data){$(\'#realisations\').empty().append(data)});

here is the code :

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

I need to execute $(".toexpand")开发者_开发百科.hide(); after beeing sure the data is loaded into the div

this try dont work :

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


$(document).ready(function(){
    $.get("realisations.shtml",function(data) {
        $('#realisations').empty().append(data);
        $(".toexpand").hide();
    })
});


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


is there a reason you aren't using $().load() ?

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

精彩评论

暂无评论...
验证码 换一张
取 消