加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

使用ajax后,target失效,弹出新窗口

发布时间:2020-12-16 00:40:48 所属栏目:百科 来源:网络整理
导读:我有三个frame如下: frameset rows="60,*" cols="*" frameborder="no" border="0" framespacing="0" frame src="./top.do" name="top" scrolling="No" noresize="noresize" id="top" title="top" / frameset rows="*" cols="190,*" framespacing="0" frameb

我有三个frame如下:


<frameset rows="60,*" cols="*" frameborder="no" border="0" framespacing="0">
        <frame src="./top.do" name="top" scrolling="No" noresize="noresize" id="top" title="top" />
        <frameset rows="*" cols="190,*" framespacing="0" frameborder="no" border="0">
            <frame src="./list.do" name="list" scrolling="no" noresize="noresize" id="left"/>
            <frame src="./order.do" name="content" id="content" title="content" scrolling="yes"/>
        </frameset>
    </frameset>


用了ajax之后,list里面的导航栏点击就会出现一个新窗口,而不是在content里面显示。
后来发现是没用ajax之前 在list页面:


window.parent.content<!--为window对象 -->
<!--使用后-->
window.parent.content<!--为frame对象,所以就能打开网页了。具体我也不清楚-->

解决办法为
onclick="javascript:window.parent.document.getElementById('content').contentWindow.location.href='./order.do';"<!--返回frame对象在获取window对象就不会错了-->

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读