【发布时间】:2009-10-09 08:49:47
【问题描述】:
我刚开始接触dojo,我已经明白dojo.query 与jQuery 中的$ 相同。
但我还没弄清楚它会返回什么。它是像 jQuery 那样的特殊对象吗?
我想做的(没有运气)是:
dojo.query("output").innerHTML = data;
//this doesn't work either:
dojo.query("output").html(data);
//tried accessing by id as well
dojo.query("#output").html(data);
//and tried to access a div, incase dojo has some issues with html5 elements
dojo.query("#divOutput").html(data);
我目前正在使用新的html5 elements:
<output id="output">Output goes here</output>
<div id="divOutput">non-html5 output goes here</div>
而且我似乎找不到关于如何处理dojo.query()..返回的对象的好列表。
编辑:好的,我认为道场现在只是在惹我生气。我找到了这个方法:addContent(),它适用于上述选择器。但是我不想添加内容,我想替换内容...
【问题讨论】:
标签: dojo