Trigger events in iframe's parent window

前端 未结 4 1466
青春惊慌失措
青春惊慌失措 2020-12-13 10:13

Why is the following not working:

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

//parent window:
$(document).bind(\'complete\', function(){
  a         


        
4条回答
  •  囚心锁ツ
    2020-12-13 10:40

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

    try

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

提交回复
热议问题