拦截点击iframe中的内容 [英] Intercept click on content in an iframe

查看:582
本文介绍了拦截点击iframe中的内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 iframe ,它引用了一个提供包含Flash广告的网页的外部网址。

我需要跟踪客户点击其中一个广告的频率。



我采用的方法是呈现 div 元素覆盖 iframe 。这允许我拦截click事件,但是我需要将该点击传递给 iframe 。这是可能的使用JavaScript?

解决方案

不,这是不可能的。您无法在JavaScript中模拟真正的点击,您只能触发点击事件。


I have an iframe that references an external URL that serves up pages that contain Flash adverts.

I need to track how often a customer clicks on one of those adverts.

The approach I am taking is to render a div element over the iframe. This allows me to intercept the click event, however I need to pass that click down to the iframe. Is this possible using JavaScript?

解决方案

No, it's not possible. You can't simulate a real click in javascript, you can only fire click events.

这篇关于拦截点击iframe中的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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