题
这是代码:
<script>
$(document).ready(function(){
$.get("realisations.shtml",function(data){$('#realisations').empty().append(data)});
});
</script>
我需要执行$(&quot; .toexpand&quot;)。hide();在确定数据被加载到div
之后这个尝试不起作用:
<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>
你有没有使用$()。load()?
的原因$(document).ready(function(){
$('#realisations').load("realisations.shtml", function() {
$(".toexpand").hide();
});
});
不隶属于 StackOverflow