1

I'm trying to create function that execute event when user click inside iframe with different domain. Call to event from child to parent on every click. So because there's cross domain between the iframe and the parent i created 2 function. The first function is to identify when the window get focusout and the iframe is get focus:

$(window).bind('focusout', function () {   
    //iframe focused
    DoSomething(); 
});

And the second is "DoSomething()". I can execute the event I wanted but I can't count the number of clicks inside the iframe because the cross-domain, so in every call to DoSomething() i return to window the focus.

function DoSomething(){
     $('#countOfClicks').append('Wow! Another click inside iframe!');
     $(window).focus();
  }

This is the solution to detect the count of clicks inside iframe with different domain. It works good in IE, Chrome, Safari...but it's not working in Firefox because "$(window).focus();" is not do anything in Firefox. Anyone? How can i return the focus to window again? Thank you all!

Tomer Levi
  • 11
  • 1

0 Answers0