报错信息: arrow.html:44 Uncaught SecurityError: Blocked a frame with origin "null" from accessing a frame with origin "null". Protocols, domains, and ports must match. 报错代码: $(".main").click( function() { var tartget = window.par…
第一种情况:iframe中不存在name和id的方法:(通过contentWindow获取) var iframe = document.getElementsByTagName('iframe')[0];var ifr_document = iframe.contentWindow.document;//iframe中的文档内容 或者: var _iframe = document.getElementByIdx_x('iframeId').contentWindow; var _div…
Js获取下拉框的值和文本网上提供了2种方法:但有些人很不负责任,他们根本没考虑到浏览器之间的差异导致的错误,导致很多新手琢磨了半天找不出错误! 下面我总结下Firefox和IE下获取下拉框选定项的值和文本: 1. IE和Firefox都支持的方法: 获取文本 var obj=document.getElementById('select_template'); var text=obj.options[obj.selectedIndex].text;//获取文本 var obj=document…