Devolución de llamada múltiple en $ .get
Pregunta
aquí está el código:
<script>
$(document).ready(function(){
$.get("realisations.shtml",function(data){$('#realisations').empty().append(data)});
});
</script>
Necesito ejecutar $ (" .toexpand "). hide (); después de estar seguro de que los datos se cargan en el div
este intento no funciona:
<script>
$(document).ready(function(){
$.get("realisations.shtml",function(data){$('#realisations').empty().append(data)},function(){$(".toexpand").hide()});
});
</script>
Solución
$(document).ready(function(){
$.get("realisations.shtml",function(data) {
$('#realisations').empty().append(data);
$(".toexpand").hide();
})
});
Otros consejos
<script>
$(document).ready(function(){
$.get("realisations.shtml",function(data) {
$('#realisations').empty().append(data);
$(".toexpand").hide();
});
});
</script>
¿hay alguna razón por la que no estás usando $ (). load ()?
$(document).ready(function(){
$('#realisations').load("realisations.shtml", function() {
$(".toexpand").hide();
});
});
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow