伙计们无法在 HTML5 代码中使用 dijit 小部件。它与遗留代码完全兼容dojoType
。HTML5 代码有什么问题?
<!DOCTYPE >
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="js/dijit/themes/tundra/tundra.css">
<script type="text/javascript" src="js/dojo/dojo.xd.js" data-dojo-config="async: true"></script>
<script type="text/javascript">
dojo.require("dojo.parser");
dojo.require("dijit.form.Form");
dojo.require("dijit.form.Button");
dojo.require("dijit.form.ValidationTextBox");
dojo.require("dijit.form.DateTextBox");
</script>
</head>
<body class="tundra">
<table style="border: 1px solid black;">
<tr>
<td>Name:</td>
<td><input type="text" id="name" name="name"
data-dojo-type="dijit.form.ValidationTextBox" /></td>
</tr>
<tr>
<td>Date of birth:</td>
<td><input type="text" id="dob" name="dob"
data-dojo-type="dijit.form.DateTextBox" /></td>
</tr>
</table>
<input type="button" name="submitButton" value="Submit" />
</body>
</html>