javascript - document.frame is not working in ie11 -


i getting undefined object error while executing in ie 11 without compatible mode. works fine in ie 11 compatible mode.

sample code:

<html xmlns="http://www.w3.org/1999/xhtml"> <head>     <script>         function test() {             var parent = document.getelementbyid("tabpanemain");             var doc = document;             var html = '<div class="tab-page" id="tabcust" style="width: 100%; height: 95%">'                     + '<h2 class="tab">customer</h2>'                     + '<table cellpadding=2 cellspacing=0 width="100%" height="100%">'                     + '<tr><td valign=top id=iframeparent_tabcust>'                     + '<iframe name="iframe_tabcust" id="iframe_tabcust" src="overview.html" style="width=100%; height: 100%;" scrolling="no" frameborder=0></iframe>'                     + '</td></tr></table></div>';              var node = doc.createelement("div");             node.innerhtml = html;             parent.appendchild(node);             var test = node.document.frames["iframe_tabcust"];// undefined error: when execute in ie 11 without compatibile mode          }     </script>  </head> <body>     <div class="tab-pane" id="tabpanemain" style="left: 10px; height: 100%" />     <button id="btn" type="button" onclick="test();">         click     </button>  </body>  </html> 

thanks in advance

your node variable div element. last checked, div doesn't have document property. node.document undefined , node.document.frames error.

window.frames standard place list of frames.


since have unique id on frame, simplest , "cross browser supported" way obtain frame is:

document.getelementbyid("iframe_tabcust") 

Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -