Sunday, June 2, 2024
 Popular · Latest · Hot · Upcoming
103
rated 0 times [  109] [ 6]  / answers: 1 / hits: 36799  / 14 Years ago, wed, january 5, 2011, 12:00:00

Why is the following not working:



//iframe:
window.parent.$(document).trigger('complete');

//parent window:
$(document).bind('complete', function(){
alert('Complete');
});


while the following IS working:



//iframe:
window.parent.$('body').trigger('complete');

//parent window:
$('body').bind('complete', function(){
alert('Complete');
});


?


More From » jquery

 Answers
99

The way events are tracked, you can only trigger or receive events on the same document.



try



window.parent.$(window.parent.document).trigger('complete');

[#94373] Monday, January 3, 2011, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
trinityr

Total Points: 49
Total Questions: 107
Total Answers: 96

Location: Mayotte
Member since Fri, Oct 1, 2021
3 Years ago
;