使用 jquery,我怎么能在加载 dom 后做一些事情,我这样写:
<script>
$("#google").load(function() {
alert('ok');
});
</script>
<img src="http://www.google.com/images/logos/ps_logo2.png" id="google" />
但什么也没有发生~如果我使用 ready() 而不是像这样加载:
<script>
$("#google").ready(function() {
alert(this);
alert('ok');
});
</script>
<img src="http://www.google.com/images/logos/ps_logo2.png" id="google" />
,可以,但是指针"this"不会是$("#google"),而且好像是"window"之类的东西,感觉很迷茫~