Execute javascript function through the third window

0

I have a grandfather window, through it I open a modal parent window and through this modal I open a second modal window child. I'm trying to do a click with trigger ('clique') in the grandfather window, but I'm not getting it, it only works if I put the click function in the modal window parent.

Can anyone help me?

Daughter modal window:

<script>
$(document).ready(function() {
    $('.ok').click(function() {
        var exec4 = $('.exec-zeraid-card');
        exec4.trigger('click');
    });
    return false;
});
</script>

Window grandfather page:

<script>
$(document).ready(function() {
    $('.exec-zeraid-card').click(function() {
        $('#box').hide(0);
    });
    return false;
});
</script>
    
asked by anonymous 26.10.2017 / 23:46

1 answer

1

I was able to solve my problem by making the following change:

var exec4 = $(.exec-zeraid-card', window.parent.document);
    
28.10.2017 / 17:59