当前位置:网站首页>在iframe标签中操作外层dom
在iframe标签中操作外层dom
2022-06-29 06:41:00 【六卿】
在iframe标签中操作外层dom
今天遇到了个问题,在此记录。
本身是同一个管理系统,分上下,下分左右;左侧就是菜单list,右侧就是内容区,在内容区的顶部有一个tab标签,来收集当前开启的页面,展示title,可以手动关闭。
具体内容区展示什么,使用的是iframe标签进行切换src实现的。
我这里其实问题很简单,就是在iframe中触发外层的事件,a标签控制click一下就可以。
这里使用了jq:
const changeAElement =(href,name)=>{
$("#transAElement", window.parent.document).attr('href', href).text(name)[0].click();
}
// 链路质量分析 详情跳转
$('.detailsBtnLeft1').on('click', () => {
let href = "/newPage.html";
let name = '质量分析'
changeAElement(href,name)
})
最外层dom:
<a id="transAElement" style="position: relative;left: -1000px;opacity: 0;" class="J_menuItem" href="">查询</a>
J_menuItem的dom会增加一个点击事件,再点击事件里面获取href属性,给iframe用作src使用。
内部项目,不再贴图。
边栏推荐
- Vibration signal generation and processing based on MATLAB Doppler effect
- Selected Siemens PLC project example source code [300 sets in total]
- Appium 环境搭建
- [industrial control old horse] detailed explanation of design principle of pattern fountain based on PLC
- Roblox sword nine sword two
- AI and the meta universe sparked a spark: human beings lost only shackles and gained all-round liberation
- Schnuka: 3D visual recognition system 3D visual inspection principle
- 小白大战指针 (上)
- VMware vcenter/ESXI系列漏洞总结
- 呕心沥血总结出来的MySQL常见错误以及解决方法(二)
猜你喜欢

postman预处理/前置条件Pre-request

Unexpected exception ... code: Badrequest when downloading Xilinx 2018.2

Common MySQL errors and solutions summarized painstakingly (II)

SQL injection bypass (6)

tf. count_ nonzero
![[industrial control old horse] detailed design of PLC six way responder system](/img/9c/8bfe336bb95a028a4fb8130941ff81.png)
[industrial control old horse] detailed design of PLC six way responder system

Kingbasees v8r6 cluster maintenance case -- single instance data migration to cluster case

Protobuf 二进制文件学习及解析

【量化投资系统】因子处理安装talib

Viewing application and installation of Hana database license
随机推荐
ShapeShifter: Robust Physical Adversarial Attack on Faster R-CNN Object Detector
低配MySQL数据库几十秒插入百万数据
Vulnhub's dc9 target
SQL Server 开启cdc
【深度之眼吴恩达第四期作业班】多元线性回归Linear Regression with multiple variables总结
路由详解(九阳真经)
编程能力提升方向
SAP ui5 Beginner (I) Introduction
101. symmetric binary tree (recursive and iterative methods)
tf. to_ int64
js异或混淆代码
Cv:: mat and Base64 conversion (including picture compression and decompression)
SVM,人脸识别遇到的问题及解决方法
手把手系列---安装SpotBugs、并快速上手使用
Blue Bridge Cup - minimum frame
Electric check code configuration
[industrial control old horse] detailed design of PLC six way responder system
Detailed explanation of top and free commands
C#Mqtt订阅消息
Roblox sword nine sword two