var $d = document;
함수 $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)
}
true 반환
}
t를 반환
})();
//window.onload=function(){_jsc.util.addEvent(document,"click",showMsg("z","d"))}
_jsc.util.addEvent(document,"click ",function(){showMsg("a","b")})
function showMsg()
{
//alert(인수 유형)
//var dd= [인수[0],인수[1]]
//var o = {a:'aa', b:'bb', c:'cc'};
//var o = {};
o=인수
o=Array.prototype.slice.call(arguments,0);
for(var p in o)
{
alert(o[p]);
}
循环对象的所有属性:
<script> <br>var o = {a:'aa', b:'bb', c:'cc'}; <br>for(var p in o) <br>{ <br>alert(eval("o." p)); <br>} <br></script>
循环数组的所有元素:
<script> <br>var arr = ['11', '22', '33']; <br>for(var i in arr) <br>{ <br>alert(arr[i]); <br>} <br></script>