Usage require supplying the resource URL to load after the !. This URL can be expressed in relative terms andwill assume a root of the Dojo base by default:
require(["dojo/text!something.html"], function(something){
// something = contents of something.html
});
In particular, dojo/text is used to load Dijit templates, for example:
define(["dojo/_base/declare", "dijit/_Widget", "dojo/text!dijit/templates/Dialog.html"],
function(declare, _Widget, template){
return declare(_Widget, {
templateString: template
});
});
example:
Loads and displays helloworld.html.
require(["dojo/text!/dojo/helloworld.html", "dojo/dom-construct", "dojo/domReady!"],
function(helloworld, domConst){
domConst.place(helloworld, "output");
});
<div id="output"></div>