The function of a Do object
1) Dojo.byid (ID)
<input type="text" id="txtId" size="30">
<button type="button" onClick="alert(dojo.byId('txtId').value)">test</button>
Note: This function does not return HTML elements based on the Name property, even in IE.
<input type="button" value="TestDiv" onClick="dojo.byId('aa').innerHTML='Test'">
<div id="xx" name="aa">Element 1</div>
<div id="aa">Element 2</div>
2) dojo.addOnLoad(functionName)和dojo.addOnUnLoad(functionName)
<script type="text/javascript">...
dojo.addOnLoad(function()...{
alert("Start");
});
</script>
Note: The parameter of the Addonload method is a reference to a function and cannot use Dojo.addonload (Myonload ()). In addition, this function name cannot be onload.
3) Dojo.require (PackageName) Call packet space
Two. String-related functions
1) dojo.string.capitalize (string str) First Letter Capital
2) Dojo.string.encodeAscii (String str) string converted to ASCII format string
3) Dojo.string.endsWith (string str,string end,boolean ignoreCase) and Dojo.string.startWith (string str,string end, Boolean ignoreCase) to see whether the string starts or ends with the specified string, and the third argument refers to whether the case is considered
4 Dojo.string.endsWithAny (string, ... str) and Dojo.string.startWithAny (string, ... str) see if the string starts or ends with any of the strings
5) Dojo.string.has (string str,substr1,substr2 ... substrn)) contains any one that returns true
6) Dojo.string.isBlank (string str) to determine if the STR string is empty
7) Dojo.string.pad (string Str,integer len,string c,integer dir) adds a C string to the left or right of STR (c defaults to 0), and the string returned after the addition is len,dir to 1 o'clock add to the left,- 1 o'clock on the right. The default is 1.
Note: abbreviated form: Dojo.string.padLeft (String Str,integer len,string C) and Dojo.string.padRight (string Str,integer len,string c)
8) dojo.string.repeat (string Str,integer count,string separator) generates a string that str repeats on count times, separator as a separator
9) Dojo.string.trim (string Str,integer wh) to space. WH is greater than 0 to the left, less than 0 to the right, not to the left
Note: abbreviated form: Dojo.string.trimStart (String str) and dojo.string.trimEnd (String str)