按下iframe中的Youtube订阅表单按钮 [英] Press Youtube Subscribe Form Button inside of iframe

查看:81
本文介绍了按下iframe中的Youtube订阅表单按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在搜索如何按下Youtube订阅表单上的订阅按钮,但是我没有找到任何可以帮助我的东西......我是JS新手,所以我希望你能帮助我。

I am searching how to press the Subscribe button from Youtube Subscribe Form, but I didn't find anything that can help me... I am new in JS, so I hope that you will help me.

要按订阅按钮此处,我使用此代码:

For pressing Subscribe button here, I use this code:

document.getElementById("subscribe-button").click();

现在我的问题是如何按下订阅按钮,当它放置在iframe中时, p>

Now my question is how to press subscribe button when this is placed in a iframe like bellow?

<html>
<body onload="">
     <iframe src="http://www.youtube.com/subscribe_widget?p=aaaa" name="iframesub" 
       style="overflow: hidden; height: 105px; width: 300px; border: 0;" 
       scrolling="no" frameBorder="0">
    </iframe>
</body>
</html>

预先感谢您。

Thank you in advance.

推荐答案

这是不可能的。 Javascript安全策略不允许跨域访问嵌入式(i)框架的文档。

This is impossible. The Javascript safety policies do not allow crossdomain access to the document of an embedded (i)frame.

这篇关于按下iframe中的Youtube订阅表单按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆