Question

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>
Was it helpful?

Solution

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

OTHER TIPS

<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();
    });
});
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top