location.href在框架中的使用target,如果只是简单的设置location.href="",会使得整个页面显示在子框架中,导致出现重叠框架。

解决办法:

window.top.framename.location.href = url;

window.parent.location.href=url;

mainframe.location.href=url;

下面是框架架构:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="frame_index.aspx.cs" Inherits="common_frame_index" %>

<%@ Import Namespace="CommonLayer" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>
        <%= CommonClass.ProjectName %></title>
        <link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon" />
</head>
<frameset rows="67,*,25" cols="*" frameborder="no" border="0" framespacing="0" vertical-align="middle;">
  <frame src="frame_top.aspx" name="topFrame" scrolling="no" noresize="noresize" id="topFrame"   />
  <frameset cols="209,7,*" frameborder="no" border="0"  framespacing="0" name= "mainContentFrame" id = "mainContentFrame" >
        <frame src="frame_left.aspx" name="leftFrame" scrolling="auto"  id="leftFrame"  noresize="noresize" />
        <frame src="frame_center.html" name="CenterFrame" id="CenterFrame" title="CenterFrame" />
            <frame src="frame_content.aspx" name="main" id="main" scrolling="yes" frameborder="no" noresize="noresize"/>
        </frameset>
   <frame src= "frame_bottom.aspx" name="bottom" scrolling="no" noresize="noresize" id="bottom" title="bottom" />

</frameset>
</html>

在框架中用JS设置target(用于location.href)相关推荐

  1. JavaWeb中外部引入的js中涉及到location.href的页面跳转/jsp页面的外部js文件引入

    当js在jsp页面中写的时候没有任何问题如下所示: function deleteP(obj){if(confirm("你真舍得丢弃我吗?")){//发送请求location.hr ...

  2. js如何获取window.location.href跳转后查询字符串的值?

    $("#worked_count").parent().attr("onClick","window.location.href='view/warn ...

  3. 关于js中window.location.href、location.href 等如何跳转

    关于js中"window.location.href"."location.href"."parent.location.href".&qu ...

  4. js中window.location.href,location.href,parent.location.href,top.location.href的用法

    "window.location.href"."location.href"是本页面跳转 "parent.location.href"是上一 ...

  5. 关于js中window.location.href,location.href,parent.location.href,top.location.href的使用方法

    关于js中"window.location.href"."location.href"."parent.location.href".&qu ...

  6. 关于js中window.location.href、location.href、parent.location.href、top.location.href的用法...

    关于js中"window.location.href"."location.href"."parent.location.href".&qu ...

  7. 关于js中window.location.href,location.href,parent.location.href,top.location.href的用法

    "window.location.href"."location.href"是本页面跳转. "parent.location.href" 是 ...

  8. 关于js中window.location.href、location.href重定向

    关于js中"window.location.href"."location.href"."parent.location.href".&qu ...

  9. php location.href,window.location.href的用法(动态输出跳转)

    javascript中的location.href有很多种用法,主要如下. self.location.href="/url" 当前页面打开URL页面 location.href= ...

  10. location.href重定向问题

    关于js中"window.location.href"."location.href"."parent.location.href".&qu ...

最新文章

  1. Linux-非结构化数据同步-Linux下Rsync+Rsync实现非结构化增量差异数据的同步2
  2. js中event,event.srcElement,event.target在IE和firefox下的兼容性
  3. Vivado之增量编译的实现
  4. 我是如何学习写一个操作系统(完结):总结和系列索引
  5. gitlab 构建tag_GitLab常用命令 分支 Tag 配置 操作
  6. 中国9大民居建筑,你都认识吗?
  7. ffmpeg 分辨率 压缩_用GPU加速FFmpeg中的超分辨率功能
  8. 汇编里的IMPORT和EXPORT
  9. chromedriver放在哪个目录下_Windows下ThinkPHP与Linux互通
  10. 交叉熵的本质是极大似然估计
  11. UITextfield键盘相关设置
  12. mysql my.cnf中忽略大小写_修改my.cnf ,使mysql 的表面不区分大小写
  13. 【HDU 4925】BUPT 2015 newbie practice #2 div2-C-HDU 4925 Apple Tree
  14. python图形化监控系统界面_手把手教你实现一个可视化爬虫监控系统,酷炫的图形化界面...
  15. 巴菲特:我们最大的错误不是做错了什么,而是该做的没做
  16. textarea 的中文输入判断与搜狗输入法的特殊行为
  17. 微信小程序自带地图_微信小程序 地图(map)实例详解
  18. 通过requests获取网络上图片的大小
  19. 利用Excel去除重复项
  20. SSM餐饮管理点餐系统

热门文章

  1. 贝店与谷歌、阿里巴巴同台亮相电博会,获市领导点赞
  2. Spire.Doc 教程:在C#,VB.NET创建、编辑和保存Word
  3. HDU 2604 Queuing( 递推关系 + 矩阵快速幂 )
  4. 自定义页面hashmap 方便调用
  5. 【原译】什么是TCHAR,WCHAR,LPSTR,LPWSTR,LPCTSTR.等等
  6. CSS块元素与内联元素(转)
  7. slackware简介
  8. 3.Docker技术入门与实战 --- 使用Docker镜像
  9. 5.PHP 命令行模式
  10. 18. RSS订阅(RSS Feeds)and price rule