Triggering a jQuery event from iframe

前端 未结 3 1831
失恋的感觉
失恋的感觉 2021-02-07 06:44

Here\'s the scenario, I have events happening from within an iframe and up until now everything is working well. I just ran into the problem where I want to dispatch an event fr

3条回答
  •  温柔的废话
    2021-02-07 06:56

    Try this in the iframe js code

    var parentWin = $( window.parent.document.body );
    jQuery.event.trigger('eventName', parentWin.data(), parentWin );
    

提交回复
热议问题