1. Do object functions
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 attribute even in IE.
<Input type = "button" value = "testdiv" onclick = "dojo. byid ('A'). innerhtml = 'test'">
<Div id = "XX" name = "AA"> element 1 </div>
<Div id = "AA"> element 2 </div>
2) Dojo. addonload (functionname) and 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. You cannot use dojo. addonload (myonload ()). In addition, the function name cannot be onload.
3) Dojo. Require (packagename)Call package Space
Ii. String-related functions
1) Dojo. String. capitalize (string Str)Uppercase letters
2) Dojo. String. encodeascii (string Str)Convert a string to an ASCII string
3) dojo. String. endswith (string STR, string end, Boolean ignorecase) andDojo. String. startwith (string STR, string end, Boolean ignorecase)Check whether the string starts or ends with a specified string. The third parameter indicates whether the string is case sensitive.
4) dojo. String. endswithany (string,... str) andDojo. String. startwithany (string,... str)Check whether the string starts or ends with any one of the strings.
5) dojo. String. Has (string STR, substr1, substr2... substrn ))Returns true if any one is included.
6) Dojo. String. isblank (string Str)Judge whether the STR string is null
7) Dojo. String. Pad (string STR, integer Len, string C, integer DIR)Add a C string to the left or right of STR (C is 0 by default). The length of the string returned after addition is Len. If DIR is 1, add it to the left and-1 to the right. The default value is 1.
Note: simple form:Dojo. String. padleft (string STR, integer Len, string C) andDojo. String. padright (string STR, integer Len, string C)
8) dojo. String. Repeat (string STR, integer count, string separator)Generate STR string that has been repeated count times. The separator is separator.
9) dojo. String. Trim (string STR, integer Wh)Remove spaces. Wh is greater than 0 to the left, less than 0 to the right, left and right are not specified
Note: simple form:Dojo. String. trimstart (string Str) and dojo. String. trimend (string Str)