Dojo - XHTML validation?

流过昼夜 提交于 2019-12-08 01:27:24

Yes, instead of using the dojoType="dojo.foo.bar" non-standard attribute, you instead need to have a document onload event that "takes over" standard HTML tags in your document and rewrites them into Dojo ones.

CDATA won't help you here. If you really want to write code according to XHTML DTD/schema, you can do it, but cannot take advantage of the flexibility of Dojo markup language (DojoML). What you can do is that you define your own way to mark the widgets, like <div class="dojoButton"/> and then you instantiate them on the page load using something like:

dojo.query('div[class=dojoButton]').instantiate(
  dijit.form.Button, {}
);

Before you do that, please have a look at this paragraph Dojo Doesn’t Validate (in the middle of the article) and this Dojo Degradability.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!