首页前端开发HTML超链接打开目标(target)的测试

超链接打开目标(target)的测试

时间2024-01-26 22:51:03发布访客分类HTML浏览758
导读:收集整理的这篇文章主要介绍了超链接打开目标(target 的测试,觉得挺不错的,现在分享给大家,也给大家做个参考。 链接的target属性决定了链接在哪边打开,它的值通常为以下五种:_blank、_self、_parent、_to...
收集整理的这篇文章主要介绍了超链接打开目标(target)的测试,觉得挺不错的,现在分享给大家,也给大家做个参考。 链接的target属性决定了链接在哪边打开,它的值通常为以下五种:_blank、_self、_parent、_top和自定义,依次表示为:新窗口、当前窗口、父窗口、顶层窗口和框架。当所指名称的框架不存在时,自定义作用等同于_blank。今天我们主要测试一下当所指名称的框架处于不同层次页面中或不同层次页面中都有该名称框架时链接在哪个框架中打开?
一、测试
1.测试一:指定名称的框架处于不同层次页面中
index.htm:
iframe name="frame1" src="" width="400" height="400"> /iframe>
iframe src="aaa.htm" width="400" height="400"> /iframe>
aaa.htm:
iframe name="frame2" src="bbb.htm" width="300" height="300"> /iframe>
a href="https://www.js-code.COM/" target="frame1"> Links/a>
bbb.htm:
iframe name="frame3" src="" width="200" height="200"> /iframe>
测试结果:
当target="frame1"时,在index.frame1中打开;(为方便说明,框架位置统一用"页面名称.框架名称"格式)
当target="frame2"时,在aaa.frame2中打开;
当target="frame3"时,在bbb.frame3中打开;
2.测试二:不同层次页面中存在同名称的框架
index.htm:
iframe name="frame1" src="" width="400" height="400"> /iframe>
iframe src="aaa.htm" width="400" height="400"> /iframe>
aaa.htm:
iframe name="frame2" src="bbb.htm" width="300" height="300"> /iframe>
a href="https://www.js-code.com/" target="frame2"> Links/a>
bbb.htm:
iframe name="frame2" src="" width="200" height="200"> /iframe>
测试结果:
当target="frame2"时,在aaa.frame2中打开;
3.测试三:不同层次页面中存在同名称的框架
index.htm:
iframe name="frame2" src="" width="400" height="400"> /iframe>
iframe src="aaa.htm" width="400" height="400"> /iframe>
aaa.htm:
iframe name="frame2" src="bbb.htm" width="300" height="300"> /iframe>
a href="https://www.js-code.com/" target="frame2"> Links/a>
bbb.htm:
iframe name="frame3" src="" width="200" height="200"> /iframe>
测试结果:
当target="frame2"时,在aaa.frame2中打开;
4.测试四:不同层次页面中存在同名称的框架
index.htm:
iframe name="frame1" src="" width="400" height="400"> /iframe>
iframe src="aaa.htm" width="400" height="400"> /iframe>
aaa.htm:
iframe name="frame2" src="bbb.htm" width="300" height="300"> /iframe>
a href="https://www.js-code.com/" target="frame1"> Links/a>
bbb.htm:
iframe name="frame1" src="" width="200" height="200"> /iframe>
测试结果:
当target="frame1"时,在bbb.frame1中打开;
二、结论
当要打开一个链接时,先在本页面中搜索指定名称(target)的框架,找不到则在下层页面中搜索,还找不到就到上层页面中搜索,都找不到打开一个新的窗口!

声明:本文内容由网友自发贡献,本站不承担相应法律责任。对本内容有异议或投诉,请联系2913721942#qq.com核实处理,我们将尽快回复您,谢谢合作!

&gtltquotheightwidth打开测试目标链接

若转载请注明出处: 超链接打开目标(target)的测试
本文地址: https://pptw.com/jishu/587383.html
网页输入框的样式触发效果 html插入链接的实现方法

游客 回复需填写必要信息