firemail

标题: 获取查看设置相关属性---常用方法 [打印本页]

作者: hechengjin    时间: 2015-11-5 23:25
标题: 获取查看设置相关属性---常用方法
本帖最后由 hechengjin 于 2015-11-12 11:08 编辑
  1. ---颜色----
  2. style="background-color: rgb(0,0,255);"
  3. style="background-color: transparent;

  4. --------------js中动态设置vbox的背景图片-----
  5. document.getElementById("tabframe_sign").style.backgroundImage = 'url("chrome://messenger/skin/preferences/background.png")';

  6. ---遍历对象属性及值---
  7. for(attribute in obs){
  8.             alert(attribute);
  9.    var objectValue = eval('obs.' + attribute);
  10.    alert(objectValue);
  11. }
复制代码

作者: hechengjin    时间: 2015-11-12 11:09
本帖最后由 hechengjin 于 2015-11-12 11:25 编辑

console.log(JSON.stringify(hdrInbox));

for(attribute in hdrTest){
       let objectValue = eval('obs.' + attribute);
       console.log('attribute:' + objectValue);
    }
  1.   function listAllKeysAndValue(obj) {
  2.     let keys = Object.keys(obj);
  3.    
  4.     for(let i = 0; i < keys.length; i++){
  5.        let objectValue = eval('obj.' + keys[i]);
  6.        console.log(keys[i] + ':' + objectValue);
  7.     }
  8.   }
复制代码

作者: java    时间: 2017-3-23 22:59
  1. var print_object = function (object)  
  2.         {  
  3.          var obj =object;  
  4.          var str="";  
  5.          for(each in obj)  
  6.          {  
  7.          str += each +":" +obj[each]+"<br/>";  
  8.          }  
  9.          alert(str);
  10.         };
复制代码
  1. function print_object(object)  
  2. {  
  3. var obj =object;  
  4. var str="";  
  5. for(each in obj)  
  6. {  
  7. str += each +":" +obj[each]+"<br/>";  
  8. }  
  9. document.getElementById("div_debug").innerHTML=str;  
  10. }  
  11.   
  12.   
  13. window.onload=function()  
  14. {  
  15. print_object(document.getElementById('div_debug'));  
  16. }  
复制代码





欢迎光临 firemail (http://firemail.wang:8088/) Powered by Discuz! X3