简体   繁体   English

如何触发其他网站的按钮

[英]How do I Trigger the button of other website

I have a I frame and inside the iframe is another website. 我有一个I框架,在iframe内是另一个网站。 I want to trigger the button of login to my external button 我想触发登录按钮到我的外部按钮

在此处输入图片说明

If it's from another site/domain, you can't do it, it has to be on the same domain. 如果它来自另一个站点/域,则不能执行此操作,它必须位于同一域中。 To access elements within the iframe on the same domain you could use the frames property of the window object 要访问同一域上iframe中的元素,可以使用window对象的frames属性

let iframeBtn = window.frames['yourIFrame'].document.getElementById('buttonId');

//code to trigger the button inside the iframe

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM