ie的innerHTML访问出错,无语的错误

来源:互联网 发布:php 反射机制 编辑:程序博客网 时间:2024/06/06 06:54

----------代码-------

function obj_for_v(obj_str)
{
   if ( (typeof(obj_str) == 'undefined') || ( /^\s*$/g.test(obj_str.toString()) ) )
     return textarea_js.value = "//请在下面的单引号之间输入要取属性的对象js字符串\n\ntop.obj_for_v('  obj  ');";
      
    try{      
      if ( typeof(obj_str) == 'string')
      {
        var pro_t = '\n\n'+ obj_str + "." + '\n\n';
        obj_str = eval(obj_str);
      }else
       {
         var pro_t = '\n\n'+ obj_str + "=" + window.obj_for_v.caller + '\n的\n';
       }
      
      var tmp;
      
      for (var pro in obj_str)
      {
        tmp = "pro_t += pro + '=' + obj_str." + pro + " + '\\n'; "
      
        try
        {
          eval(tmp);
        }catch(E)
         {
           pro_t += pro + ": 访问(" + tmp + ")此属性出错信息:" + E.description + "\n";
         }
      }
 
      textarea_js.value += pro_t;
    }catch(e)
     {
       alert('可能你输入的对象不存在!\n出错信息如下:\n' + e.description);
     }
}

-------------------输出----------------

top.obj_for_v('  win.document.body  ');

  win.document.body  .

nextSibling=null
onresizeend=null
onrowenter=null
aria-haspopup: 访问(pro_t += pro + '=' + obj_str.aria-haspopup + '\n'; )此属性出错信息:“haspopup”未定义
childNodes=[object]
ondragleave=null
oncut=null
clientHeight=400
onbeforepaste=null
ondragover=null
onbeforecopy=null
aria-disabled: 访问(pro_t += pro + '=' + obj_str.aria-disabled + '\n'; )此属性出错信息:“disabled”未定义
onpage=null
recordNumber=null
previousSibling=[object]
nodeName=BODY
onbeforeactivate=null
accessKey=
currentStyle=[object]
onfocusin=null
onbeforeeditfocus=null
oncontrolselect=null
aria-hidden: 访问(pro_t += pro + '=' + obj_str.aria-hidden + '\n'; )此属性出错信息:“hidden”未定义
onblur=null
hideFocus=false
style=[object]
onbeforedeactivate=null
dir=
aria-expanded: 访问(pro_t += pro + '=' + obj_str.aria-expanded + '\n'; )此属性出错信息:“expanded”未定义
onkeydown=null
nodeType=1
ondragstart=null
scrollTop=0
onscroll=null
onpropertychange=null
ondragenter=null
id=
aria-level: 访问(pro_t += pro + '=' + obj_str.aria-level + '\n'; )此属性出错信息:“level”未定义
onrowsinserted=null
onmovestart=null
scopeName=HTML
lang=
onmouseup=null
aria-busy: 访问(pro_t += pro + '=' + obj_str.aria-busy + '\n'; )此属性出错信息:“busy”未定义
oncontextmenu=null
language=
offsetWidth=980
onbeforeupdate=null
onreadystatechange=null
onload=function onload()
{
load_init();
}
filters=[object]
onresize=null
isContentEditable=false
aria-checked: 访问(pro_t += pro + '=' + obj_str.aria-checked + '\n'; )此属性出错信息:“checked”未定义
aria-readonly: 访问(pro_t += pro + '=' + obj_str.aria-readonly + '\n'; )此属性出错信息:“readonly”未定义
oncopy=null
onselectstart=null
scrollHeight=400
onmove=null
ondragend=null
onrowexit=null
lastChild=[object]
aria-secret: 访问(pro_t += pro + '=' + obj_str.aria-secret + '\n'; )此属性出错信息:“secret”未定义
onactivate=null
canHaveChildren=true
onfocus=null
isMultiLine=true
onmouseover=null
offsetTop=0
parentNode=[object]
tagName=BODY
className=
canHaveHTML=true
onmousemove=function onmousemove()
{
show_url()
}
title=
role=
behaviorUrns=[object]
onfocusout=null
onfilterchange=null
disabled=false
parentTextEdit=null
ownerDocument=[object]
offsetParent=null
aria-posinset: 访问(pro_t += pro + '=' + obj_str.aria-posinset + '\n'; )此属性出错信息:“posinset”未定义
ondrop=null
ondblclick=null
onrowsdelete=null
tabIndex=0
onkeypress=null
aria-relevant: 访问(pro_t += pro + '=' + obj_str.aria-relevant + '\n'; )此属性出错信息:“relevant”未定义
onlosecapture=null
innerText=+ 查找电影面板
清屏 底部↓ 查找电影->   


调整窗口大小时出错:窗口初始化时请不要把窗口最小化,否则程序调整出错,影响正常使用。

查询电影系统准备好.你可以输入关键字[查找电影]了.

清屏 顶部↑
+ 电影自动连播排队列表
允许自动播放下部电影
 
+ 看过/未看电影名字列表
新增(播放中片名或修改)
 
记住观看进度(播放中片名,片源,已播放时间)
 
+ 窗口控制面板
窗口总在最前面
 
取消窗口总在最前面
 
关闭程序(并退出后台下载程序,不再占用网速)
 
关闭程序(不退出后台下载程序,会占用网速)
 
更新程序(并退出后台下载程序,不再占用网速)
 
更新程序(不退出后台下载程序,会占用网速)
 
更新播放器(某些操作无效后可以尝试)
 
+ 播放硬盘中电影
播放 ->  
+ 修改程序
打开源文件
 
打开程序目录
 
+ 关于程序
使用帮助
 
修改更新记录
 
关于程序
 
aria-live: 访问(pro_t += pro + '=' + obj_str.aria-live + '\n'; )此属性出错信息:“live”未定义
parentElement=[object]
ondeactivate=null
aria-labelledby: 访问(pro_t += pro + '=' + obj_str.aria-labelledby + '\n'; )此属性出错信息:“labelledby”未定义
aria-pressed: 访问(pro_t += pro + '=' + obj_str.aria-pressed + '\n'; )此属性出错信息:“pressed”未定义
children=[object]
ondatasetchanged=null
ondataavailable=null
aria-invalid: 访问(pro_t += pro + '=' + obj_str.aria-invalid + '\n'; )此属性出错信息:“invalid”未定义
onafterupdate=null
nodeValue=null
onmousewheel=null
onkeyup=null
readyState=complete
aria-valuenow: 访问(pro_t += pro + '=' + obj_str.aria-valuenow + '\n'; )此属性出错信息:“valuenow”未定义
aria-selected: 访问(pro_t += pro + '=' + obj_str.aria-selected + '\n'; )此属性出错信息:“selected”未定义
onmouseout=null
aria-owns: 访问(pro_t += pro + '=' + obj_str.aria-owns + '\n'; )此属性出错信息:“owns”未定义
aria-valuemax: 访问(pro_t += pro + '=' + obj_str.aria-valuemax + '\n'; )此属性出错信息:“valuemax”未定义
onmoveend=null
document=[object]
firstChild=[object]
sourceIndex=9
outerText=+ 查找电影面板
清屏 底部↓ 查找电影->   


调整窗口大小时出错:窗口初始化时请不要把窗口最小化,否则程序调整出错,影响正常使用。

查询电影系统准备好.你可以输入关键字[查找电影]了.

清屏 顶部↑
+ 电影自动连播排队列表
允许自动播放下部电影
 
+ 看过/未看电影名字列表
新增(播放中片名或修改)
 
记住观看进度(播放中片名,片源,已播放时间)
 
+ 窗口控制面板
窗口总在最前面
 
取消窗口总在最前面
 
关闭程序(并退出后台下载程序,不再占用网速)
 
关闭程序(不退出后台下载程序,会占用网速)
 
更新程序(并退出后台下载程序,不再占用网速)
 
更新程序(不退出后台下载程序,会占用网速)
 
更新播放器(某些操作无效后可以尝试)
 
+ 播放硬盘中电影
播放 ->  
+ 修改程序
打开源文件
 
打开程序目录
 
+ 关于程序
使用帮助
 
修改更新记录
 
关于程序
 
isTextEdit=true
scrollLeft=0
isDisabled=false
oncellchange=null
runtimeStyle=[object]
scrollWidth=980
aria-valuemin: 访问(pro_t += pro + '=' + obj_str.aria-valuemin + '\n'; )此属性出错信息:“valuemin”未定义
onlayoutcomplete=null
onhelp=null
attributes=[object]
offsetHeight=400
onerrorupdate=null
contentEditable=inherit
onmousedown=null
aria-setsize: 访问(pro_t += pro + '=' + obj_str.aria-setsize + '\n'; )此属性出错信息:“setsize”未定义
clientWidth=980
onpaste=null
tagUrn=
onmouseleave=null
clientLeft=0
onselect=null
onclick=null
outerHTML: 访问(pro_t += pro + '=' + obj_str.outerHTML + '\n'; )此属性出错信息:
ondrag=null
aria-controls: 访问(pro_t += pro + '=' + obj_str.aria-controls + '\n'; )此属性出错信息:“controls”未定义
onresizestart=null
aria-flowto: 访问(pro_t += pro + '=' + obj_str.aria-flowto + '\n'; )此属性出错信息:“flowto”未定义
ondatasetcomplete=null
aria-required: 访问(pro_t += pro + '=' + obj_str.aria-required + '\n'; )此属性出错信息:“required”未定义
clientTop=0
aria-describedby: 访问(pro_t += pro + '=' + obj_str.aria-describedby + '\n'; )此属性出错信息:“describedby”未定义
onmouseenter=null
all=[object]
onbeforecut=null
innerHTML: 访问(pro_t += pro + '=' + obj_str.innerHTML + '\n'; )此属性出错信息:
aria-activedescendant: 访问(pro_t += pro + '=' + obj_str.aria-activedescendant + '\n'; )此属性出错信息:“activedescendant”未定义
aria-multiselectable: 访问(pro_t += pro + '=' + obj_str.aria-multiselectable + '\n'; )此属性出错信息:“multiselectable”未定义
offsetLeft=0
onunload=null
bottomMargin=15
onbeforeprint=null
background=
aLink=
leftMargin=10
rightMargin=10
ononline=null
scroll=
onoffline=null
onafterprint=null
bgProperties=
onhashchange=null
onbeforeunload=function window.onbeforeunload()
{
     kill_qvod();
     save_cf();
}
topMargin=15
noWrap=false
bgColor=
text=
vLink=
link=

-------------------无语的是---------

innerText可以使用,

而innerHTML使用时将会导致出错,而不是没有值,且连出错信息都无法捕捉.如果没加try,将会提示"未明错误".也就是无法追踪的问题.


---------另外测试输出----------

 

top.obj_for_v('  win.document.body  ');


  win.document.body  .

nextSibling=null
onresizeend=null
onrowenter=null
aria-haspopup: 访问(pro_t += pro + '=' + obj_str.aria-haspopup + '\n'; )此属性出错信息:“haspopup”未定义
childNodes=[object]
ondragleave=null
oncut=null
clientHeight=506
onbeforepaste=null
ondragover=null
onbeforecopy=null
aria-disabled: 访问(pro_t += pro + '=' + obj_str.aria-disabled + '\n'; )此属性出错信息:“disabled”未定义
onpage=null
recordNumber=null
previousSibling=[object]
nodeName=BODY
onbeforeactivate=null
accessKey=
currentStyle=[object]
onfocusin=null
onbeforeeditfocus=null
oncontrolselect=null
aria-hidden: 访问(pro_t += pro + '=' + obj_str.aria-hidden + '\n'; )此属性出错信息:“hidden”未定义
onblur=null
hideFocus=false
style=[object]
onbeforedeactivate=null
dir=
aria-expanded: 访问(pro_t += pro + '=' + obj_str.aria-expanded + '\n'; )此属性出错信息:“expanded”未定义
onkeydown=null
nodeType=1
ondragstart=null
scrollTop=0
onscroll=null
onpropertychange=null
ondragenter=null
id=
aria-level: 访问(pro_t += pro + '=' + obj_str.aria-level + '\n'; )此属性出错信息:“level”未定义
onrowsinserted=null
onmovestart=null
scopeName=HTML
lang=
onmouseup=null
aria-busy: 访问(pro_t += pro + '=' + obj_str.aria-busy + '\n'; )此属性出错信息:“busy”未定义
oncontextmenu=null
language=
offsetWidth=1017
onbeforeupdate=null
onreadystatechange=null
onload=null
filters=[object]
onresize=null
isContentEditable=false
aria-checked: 访问(pro_t += pro + '=' + obj_str.aria-checked + '\n'; )此属性出错信息:“checked”未定义
aria-readonly: 访问(pro_t += pro + '=' + obj_str.aria-readonly + '\n'; )此属性出错信息:“readonly”未定义
oncopy=null
onselectstart=null
scrollHeight=68
onmove=null
ondragend=null
onrowexit=null
lastChild=[object]
aria-secret: 访问(pro_t += pro + '=' + obj_str.aria-secret + '\n'; )此属性出错信息:“secret”未定义
onactivate=null
canHaveChildren=true
onfocus=null
isMultiLine=true
onmouseover=null
offsetTop=0
parentNode=[object]
tagName=BODY
className=
canHaveHTML=true
onmousemove=null
title=
role=
behaviorUrns=[object]
onfocusout=null
onfilterchange=null
disabled=false
parentTextEdit=null
ownerDocument=[object]
offsetParent=null
aria-posinset: 访问(pro_t += pro + '=' + obj_str.aria-posinset + '\n'; )此属性出错信息:“posinset”未定义
ondrop=null
ondblclick=null
onrowsdelete=null
tabIndex=0
onkeypress=null
aria-relevant: 访问(pro_t += pro + '=' + obj_str.aria-relevant + '\n'; )此属性出错信息:“relevant”未定义
onlosecapture=null
innerText=  
aria-live: 访问(pro_t += pro + '=' + obj_str.aria-live + '\n'; )此属性出错信息:“live”未定义
parentElement=[object]
ondeactivate=null
aria-labelledby: 访问(pro_t += pro + '=' + obj_str.aria-labelledby + '\n'; )此属性出错信息:“labelledby”未定义
aria-pressed: 访问(pro_t += pro + '=' + obj_str.aria-pressed + '\n'; )此属性出错信息:“pressed”未定义
children=[object]
ondatasetchanged=null
ondataavailable=null
aria-invalid: 访问(pro_t += pro + '=' + obj_str.aria-invalid + '\n'; )此属性出错信息:“invalid”未定义
onafterupdate=null
nodeValue=null
onmousewheel=null
onkeyup=null
readyState=complete
aria-valuenow: 访问(pro_t += pro + '=' + obj_str.aria-valuenow + '\n'; )此属性出错信息:“valuenow”未定义
aria-selected: 访问(pro_t += pro + '=' + obj_str.aria-selected + '\n'; )此属性出错信息:“selected”未定义
onmouseout=null
aria-owns: 访问(pro_t += pro + '=' + obj_str.aria-owns + '\n'; )此属性出错信息:“owns”未定义
aria-valuemax: 访问(pro_t += pro + '=' + obj_str.aria-valuemax + '\n'; )此属性出错信息:“valuemax”未定义
onmoveend=null
document=[object]
firstChild=[object]
sourceIndex=3
outerText=  
isTextEdit=true
scrollLeft=0
isDisabled=false
oncellchange=null
runtimeStyle=[object]
scrollWidth=997
aria-valuemin: 访问(pro_t += pro + '=' + obj_str.aria-valuemin + '\n'; )此属性出错信息:“valuemin”未定义
onlayoutcomplete=null
onhelp=null
attributes=[object]
offsetHeight=510
onerrorupdate=null
contentEditable=inherit
onmousedown=null
aria-setsize: 访问(pro_t += pro + '=' + obj_str.aria-setsize + '\n'; )此属性出错信息:“setsize”未定义
clientWidth=997
onpaste=null
tagUrn=
onmouseleave=null
clientLeft=2
onselect=null
onclick=null
outerHTML=
<BODY><TEXTAREA id=test></TEXTAREA> <INPUT onclick="try{window.execScript(test.value,'javascript');}catch(e){} " type=button>
<SCRIPT>


window.onerror = function(sMessage,sUrl,sLine)
{
      var str = window.err_t + "出错了!\n\n";
      if (window.err_t == '初始化页面时') str += "在文件[ " + sUrl + " ]";
      str += "第" + sLine + "行\n" + sMessage + "\n\n";
    var func = window.onerror.caller;
    var index = 0;
    
    while(func!=null){
       str += "[" + index + "] 调用时参数/函数\n";
       for(var i=0;i<func.arguments.length;i++) str += func.arguments[i] + ",";
       str +=  "\n" + func + "\n\n";
       
       if (func  === func.caller) {
            break;
       }
       
       func = func.caller;
       index++;
       alert(func.caller);
    }

    alert(str);    
      return true;
}
</SCRIPT>
 </BODY>
ondrag=null
aria-controls: 访问(pro_t += pro + '=' + obj_str.aria-controls + '\n'; )此属性出错信息:“controls”未定义
onresizestart=null
aria-flowto: 访问(pro_t += pro + '=' + obj_str.aria-flowto + '\n'; )此属性出错信息:“flowto”未定义
ondatasetcomplete=null
aria-required: 访问(pro_t += pro + '=' + obj_str.aria-required + '\n'; )此属性出错信息:“required”未定义
clientTop=2
aria-describedby: 访问(pro_t += pro + '=' + obj_str.aria-describedby + '\n'; )此属性出错信息:“describedby”未定义
onmouseenter=null
all=[object]
onbeforecut=null
innerHTML=<TEXTAREA id=test></TEXTAREA> <INPUT onclick="try{window.execScript(test.value,'javascript');}catch(e){} " type=button>
<SCRIPT>


window.onerror = function(sMessage,sUrl,sLine)
{
      var str = window.err_t + "出错了!\n\n";
      if (window.err_t == '初始化页面时') str += "在文件[ " + sUrl + " ]";
      str += "第" + sLine + "行\n" + sMessage + "\n\n";
    var func = window.onerror.caller;
    var index = 0;
    
    while(func!=null){
       str += "[" + index + "] 调用时参数/函数\n";
       for(var i=0;i<func.arguments.length;i++) str += func.arguments[i] + ",";
       str +=  "\n" + func + "\n\n";
       
       if (func  === func.caller) {
            break;
       }
       
       func = func.caller;
       index++;
       alert(func.caller);
    }

    alert(str);    
      return true;
}
</SCRIPT>
 
aria-activedescendant: 访问(pro_t += pro + '=' + obj_str.aria-activedescendant + '\n'; )此属性出错信息:“activedescendant”未定义
aria-multiselectable: 访问(pro_t += pro + '=' + obj_str.aria-multiselectable + '\n'; )此属性出错信息:“multiselectable”未定义
offsetLeft=0
onunload=null
bottomMargin=15
onbeforeprint=null
background=
aLink=
leftMargin=10
rightMargin=10
ononline=null
scroll=
onoffline=null
onafterprint=null
bgProperties=
onhashchange=null
onbeforeunload=null
topMargin=15
noWrap=false
bgColor=
text=
vLink=
link=



------------------------这个输出是正常的.-----

innerHTML有值.




原创粉丝点击