CopyCode The Code is as follows: var $ d = document;
Function $ I (s) {return $ D. getelementbyid (s );}
VaR _ JSC = {}
_ JSC. Client = (function (){
VaR T = {};
VaR B = navigator. useragent. tolowercase ();
T. isopera = (B. indexof ('Opera ')>-1)
T. isie = (B. indexof ('msie ')>-1)
T. isff = (! T. isopera &&! T. isie & B. indexof ("Firefox")>-1 );
Return T;
})()
_ JSC. util = (function (){
VaR T = {}
T. addevent = function (o, e, f ){
If (_ JSC. Client. isie ){
O. attachevent ("On" + e, f)
} Else {
O. addeventlistener (E, F, fasle );
}
Return true
}
Return T;
})();
// Window. onload = function () {_ JSC. util. addevent (document, "click", showmsg ("Z", "D "))}
_ JSC. util. addevent (document, "click", function () {showmsg ("A", "B ")})
Function showmsg ()
{
// Alert (typeof arguments)
// Var dd = [arguments [0], arguments [1]
// Var o = {A: 'A', B: 'bb', C: 'cc '};
// Var o = {};
O = arguments
O = array. Prototype. Slice. Call (arguments, 0 );
For (var p in O)
{
Alert (O [p]);
}
All attributes of the loop object:
<SCRIPT>
VaR o = {A: 'A', B: 'bb', C: 'cc '};
For (var p in O)
{
Alert (eval ("O." + p ));
}
</SCRIPT>
All elements of the loop array:
<SCRIPT>
VaR arr = ['11', '22', '33'];
For (var I in ARR)
{
Alert (ARR [I]);
}
</SCRIPT>