iframe中在父窗口打开子页面】的更多相关文章

我们在做页面框架的时候,通常会采用一个iframe来显示子页面,但有这么种情况,就是session失效时,登录页面就会显示在iframe中,这不符合常理,一般应该显示在顶部才对. 下面的js代码可以解决上述问题,只需要在登录页面添加如下代码: <script type="text/javascript" > /**有父窗口则在父窗口打开*/ if(self!=top){top.location=self.location;} </script> 转自:http:…
父窗口:windowdemo.html <html> <head> <title> 接收子窗口返回的内容 </title> <script language="JavaScript"> function shownewpage(thisurl) { window.open('content.html','content','width=480,height=330,top=150,left=280, toolbar=no, m…
在web开发中,经常会用到iframe,难免会碰到需要在父窗口中使用iframe中的元素.或者在iframe框架中使用父窗口的元素 js 在父窗口中获取iframe中的元素  1. 格式:window.frames["iframe的name值"].document.getElementById("iframe中控件的ID").click(); 实例:window.frames["ifm"].document.getElementById(&quo…
一.Iframe篇 //&&&&&&&&&&&&&&&&&&&&公共方法开始&&&&&&&&&&&&&&& //父对象得到子窗口的值 //ObjectID是窗口标识,ContentID是元素ID function GetValue…
一.Iframe 篇 公共部分 //父对象得到子窗口的值 //ObjectID是窗口标识,ContentID是元素ID function GetValue(ObjectID,ContentID) { var IsIE = (navigator.appName == 'Microsoft Internet Explorer') if(IsIE) {//如果是IE alert(document.frames(ObjectID).document.getElementById(ContentID).i…
一.Iframe 篇 //&&&&&&&&&&&&&&&&&&&&公共方法开始&&&&&&&&&&&&&&& //父对象得到子窗口的值 //ObjectID是窗口标识,ContentID是元素ID function GetValu…
http://hi.baidu.com/yashua839/blog/item/131fdb2fe547ef221f3089af.html一.Iframe 篇 //&&&&&&&&&&&&&&&&&&&&公共方法开始&&&&&&&&&&&&&&a…
1>父窗口获取子窗口 js方法 document.getElementById('if1').contentWindow.document: window.frames["if1"].document.body: jQuery方法 $(this).contents(); 2>父窗口获取子窗口高度 js方法 document.getElementById('if1').contentWindow.document.body.scrollHeight: window.frame…
我们都知道可以在html代码中使用<a href="xxxx" target="_blank"></a>这种方式来打开一个新的窗口打开一个页面,但是有很多时候,我们需要在某段js代码中去打开一个新的窗口实现页面跳转.有如下几种方法来实现这个功能. 1.Window.open()方法,比如如下代码,将打开baidu首页. window.open("http://www.baidu.com") 但是这个方法是有问题的,那就是有…
iframe 父窗口和子窗口的调用方法父窗口调用子窗口 iframe_name.iframe_document_object.object_attribute = attribute_value 例子:onClick="iframe_text.myH1.innerText='http://www.pint.com';" 子窗口调用父窗口parent.parent_document_object.object_attribute = attribute_value 例子:onclick=…