IE升级代码时邮件内容

  • TypeErrorUnable to set property 'value' of undefined or null reference.

                但是可以进入添加页面,填完信息后,submit后跳转至 错误页面,(Unknown system error)

                参考解决方案:

             http://stackoverflow.com/questions/21775185/error-unable-to-set-property-value-of-undefined-or-null-reference

             https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError

  最终是因为:替换之后name要换成id.

1 <%--var hidden = document.createElement("<input type='hidden' name='<%=myid>'>");--%>
2     var hidden=document.createElement("input");
3     hidden.setAttribute("type","hidden");
4     hidden.setAttribute("id","myid");
5     obj.appendChild(hidden);
  • Unable to get property 'substring' of undefined or null reference

    解决:  document.getElementsByName("startDate").value != '' && document.getElementsByName("endDate").value != '';

         后面要加下标,如getElementsByName("")[0].value;

  • Unable to get property 'style' of undefined or null reference

   解决:document.getElementById.iframe1.style.display='none';

  • Unable to set property 'disabled' of undefined or null reference 

   解决:document.form1.birthDayStr.disabled= true;

            PS. <form name="form1"

  • 系统中在升级前就存在的document.getElementById(),某些在IE11中并不支持
1  IF :         
2      form1.actionType.value = "searchResult";
3 THEN:
4      var form1 = document.getElementsByName("form1")[0];
5  Other points Similar  
  • onclick()内的函数报_submitQuery is undefined
1 function _submitQuery(){
2  if(!_checkQuery()){
3  alert("-----");   
4 }       
5     return
6 }

      原因:_checkQuery()内的一个getElementsByName的一个下标为[],未加0;

  • 报Function expected

  原因:IE11不支持【document.frames("pendingActivities")】用法。

function doRediary(){
var radios=doucment.frames("pendingActivities").document.getElemntsByName("selectedActivities");
}

  替换为:

function doRediary(){
var radios=doucment.frames["pendingActivities"].document.getElemntsByName("selectedActivities");
}

  技术来源:blog.sina.com.cn/s/blog_74924f2401017t0a.html

  •  dispatchEvent-onchange,onmousedown,onblur,onclick适应IE11写法。
 1 var event1 = document.createEvent('HTMLEvents');
 2  event1.initEvent("change", true, true);
 3  obj.dispatchEvent(event1);
 4 
 5  var event1 = document.createEvent("MouseEvents");  
 6   event1.initMouseEvent("mousedown", true, true, window,0, 0, 0, 0, 0, false, false, false, false, 0, null);  
 7   document.body.dispatchEvent(event1);    
 8 
 9 var evt2 = document.createEvent("MouseEvent");
10  evt2.initMouseEvent("blur", true, true, window,0, 0, 0, 0, 0, false, false, false, false, 0, null);
11  document.body.dispatchEvent(evt2);
12 
13 var evt2 = document.createEvent("MouseEvent");
14  evt2.initMouseEvent("click", true, true, window,0, 0, 0, 0, 0, false, false, false, false, 0, null);
15  document.body.dispatchEvent(evt2);
  • style属性

不支持这种写法:

1 style='display: "none"'

支持下面写法:

1 style="display: none"

 

 

持续更新;

posted @ 2015-09-07 10:53  权杖攻城狮  阅读(722)  评论(0编辑  收藏  举报