【发布时间】:2009-09-11 06:41:36
【问题描述】:
var id = 'test';
var dom = $('#loader').clone().load("Views/chatBox.html");
dom.find('span.bn').text(id);
在chatBox.html中,有:
...
<span class="bn">AAA</span>
...
我想用“test”替换“AAA”,但是失败了(dom.find 无法获取它),这意味着它不能立即可用。
如何正确地做到这一点?
【问题讨论】:
-
尝试在firefox中使用firebug,看看有没有报错。
-
没有错误,当 $.find 找不到任何东西时,它会继续。