Umang
Umang

Reputation: 211

Binding click event on an iframe?

Is it possible to bind a click event to an iframe whose source is some other domain/third party? If yes, how different is it from the conventional way?

Upvotes: 0

Views: 298

Answers (2)

Optimus Prime
Optimus Prime

Reputation: 6907

Yes, as Rory mentioned in his answer,

You cannot do this because of web browser's same origin policy.

But there is a iframeTracker jQuery plugin, that claims to track clicks on iframes : https://github.com/finalclap/iframeTracker-jquery

Upvotes: 1

Rory McCrossan
Rory McCrossan

Reputation: 337646

This is not possible due to the Same Origin Policy.

Upvotes: 2

Related Questions