复制代码 代码如下:
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:'aa', b:'bb', c:'cc'};
//var o = {};
o=arguments
o=Array.prototype.slice.call(arguments,0);
for(var p in o)
{
alert(o[p]);
}

循环对象的所有属性:
<script>
var o = {a:'aa', b:'bb', c:'cc'};
for(var p in o)
{
alert(eval("o." + p));
}
</script>

循环数组的所有元素:

<script>
var arr = ['11', '22', '33'];
for(var i in arr)
{
alert(arr[i]);
}
</script>
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!