在iframe中打开的网页上调用我的jquery函数 [英] invoke my jquery function on a webpage opened in iframe

查看:103
本文介绍了在iframe中打开的网页上调用我的jquery函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想单击父页面上基于类选择器在iframe中打开的网页上的按钮.

I want to click a button which is on webpage opened in iframe based on class selector from my parent page.

我尝试过:

$.each($('.classname'), function(i, el){
  setTimeout(function(){
  $(el).trigger('click');
  },30000 + ( i * 30000 ));
});

但没有成功.我该如何实现?

but no success. How can i achieve this?

推荐答案

如果出于安全原因,iframe的src指向其他域,则您将无法使用javascript访问iframe的内容.

If the src of the iframe is pointing to a different domain, due to security reasons, you will not be able to access the contents of the iframe in javascript.

这篇关于在iframe中打开的网页上调用我的jquery函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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