Copy codeThe 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>