当前位置: 代码迷 >> ASP.NET >> 跨frame弹出窗口有关问题
  详细解决方案

跨frame弹出窗口有关问题

热度:1739   发布时间:2013-02-25 00:00:00.0
跨frame弹出窗口问题
有一个右下角弹出窗口的脚本写在main里面。只要切换页面,弹出窗口就不见了, 为避免这个问题不想在每个main框架内的页面都加上弹出窗口的脚本,也不方便维护.

有什么办法解决呢? 可以在写top里面在main框架显示弹出窗口吗?


HTML code
<frameset rows="50,30,*" frameborder="NO" border="0" framespacing="0">  <frame src="top"  noresize="noresize" frameborder="NO" name="topFrame" scrolling="no" marginwidth="0" marginheight="0">  <frame src="menu"  noresize="noresize" frameborder="NO" name="menu" scrolling="no" marginwidth="0" marginheight="0">    <frameset cols="150,9,*" frameborder="no" border="0" framespacing="0" id="frame2">      <frame src="left"name="leftFrame" noresize="noresize" marginwidth="0" marginheight="0" frameborder="0" scrolling="no"  target="main">       <frame src="line" name="line" scrolling="no"  noresize="noresize">      <frame src="main" name="main" marginwidth="0" marginheight="0" frameborder="0" scrolling="auto" target="_self">    </frameset><noframes><body></body></noframes>


------解决方案--------------------------------------------------------
你可以在top里面通过下面的代码访问main

d = window.top.frames["main"].document;
div = document.createElement("div")
div.innerHTML = "xxx";
d.body.appendChild(div)

具体的细节自己添加吧。

  相关解决方案