First, create a new directory
Second, create a new file
Third, write Urtil widget code
Four, write Redtextdialog code
Five, write HTML code
===================== If you do not understand, combined with http://blog.csdn.net/eengel/article/details/13021687 view, do not like to spray,
Specific as follows
One, two: Create a new file, create a new directory, import a dojo Package
Third, write Urtil widget code
define ([' Dojo/dom '],function (DOM) { return{ setred:function (id) { dom.byid (id). style.color= ' red '; } };} );
--------------------"Testing in HTML
<! DOCTYPE html>
<script> require ([' Test/util ', ' dojo/domready! '], function (util) { var id= ' xxx '; util.setred (ID); }); </script>
Four, write Redtextdialog code
define ([ ' Dojo/_base/declare ', ' Dijit/dialog ', ' dijit/_widgetbase ', ' dijit/_templatedmixin ', ' Test/util ' ],function (declare,dialog,_widgetbase,_templatedmixin,util) { return declare ([ Dialog,_widgetbase,_templatedmixin ],{ title: "Dialog with Red Text", ondownloadend:function () { var id= "xxx"; uril.setred (ID) ,}, //need to rewrite the show method, = = theory does not write, but I do not write _onshow:function () { this.show ();} );} );
Five, write HTML code
<body><div style= "width:100%;height:80%" id= "xxx" > Discoloration </div></body>
Finally write the full HTML code
<! DOCTYPE html> Dojo New Widget step----primarily for widget paths