for(i in pstrWord ){ alert(i); //获得属性 alert(pstrWord[i]); //获得属性值 } 1.js输出object对象方法如下: function writeObj(obj){ var description = ""; for(var i in obj){ var property=obj[i]; description+=i+" = "+property+"\n"; } console…
// var responseData = response.data.result; for (var r in responseData) { if (responseData[r]["visible"] == 0) { responseData[r]["visible"] = "是"; } else { …
原文 JS获取当前对象大小以及屏幕分辨率等 <script type="text/javascript">function getInfo(){ var s = ""; s += " 网页可见区域宽:"+ document.body.clientWidth+"\n"; s += " 网页可见区域高:"+ document.body.clien…
通过js绑定键盘按下事件onkeydown获取每个按键的ascII值. js获取每个按键的ascii值 <script language="javascript"> //获取每个按键的值 function keyDown() { var keycode=event.keyCode; var keychar=String.fromCharCode(keycode); console.log('ASCII='+keycode+'\nKeyChar='+keychar); } d…