当页面加载时,自动点击button,如ifarme

如果我想在ifarme中自动点击一个button元素,我将如何去做这个工作?

function autoclick() { document.getElementById('u_0_4').contentWindow.document.getElementById("u_0_5").click() } 
 <div onload="autoclick()" > <iframe src="https://www.facebook.com/plugins/like.php?href=https%3A%2F%2Fweb.facebook.com%2FMaherZain&width=450&layout=standard&action=like&size=small&show_faces=true&share=true&height=80&appId=788255487990117" width="450" height="80" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowTransparency="true" id="u_0_4" ></iframe> </div> 

=====>如果有任何其他方式做的,请告诉我:(

你不能这样做,否则人们会embedded一个1×1的iframe,并让每个访问者“喜欢”任何作者想要的。 让不同的来源访问指向不同来源的iframe的contentWindow是一个安全问题。

想象一下,如果你能做到这一点。 人们可以开始在1×1 iframe中embeddedgmail或银行网站,然后触发几次点击和键盘事件来重置密码。