views:

32

answers:

1

How to use onclick in iframe tag to call a javascript.

I basically want redirect to other page when a user clicks on a iframe.I have added the facebook like button my site which is a iframe code. So once he has clicked on the like button i want him to get redirected to a thank you page

EDIT: i don't want to redirect the iframe but i want to redirect the main page on any interactivity with iframe. On solution is on focus or or on click on iframe i should be able to redirect. Can i at least do it.

+3  A: 

You can't do that. Facebook's XFBML elements (like the 'Like' button) are on a different domain than your own (and only function that way); using Javascript to modify that frame isn't possible due to security restrictions.

mway
i don't want to redirect the iframe but i want to redirect the main page on any interactivity with iframe
Web Developer