So I have a main page (a) and a preview page (b) embedded into the main page via an iframe. The page (b) triggers a special event:
$(document).trigger('preview.compiled');
Now I want the main page (a) to listen to this event and do something then:
$('iframe').contents().on('preview.compiled', function() {
console.log('Success');
});
However, the code above doesn't work. Any ideas?