Avatar of APD Toronto
APD Toronto
Flag for Canada

asked on 

Blocked frame with origin from, accessing a cross-origin frame

Hi Experts,

To start, as developer, yes I have full access to both domains.

I'm trying to resize my iFrame based on the contents with the following code, but I getting the above error.
function resize_iframe(){
    
    var self_frame = $('#frame-self_register');
    if (self_frame.length != 0){
        var doc_height = self_frame.contents().find('body').height();
        doc_height += 10;
        self_frame.style.height = doc_height + 'px';
    }
    
}

Open in new window


I have read that Window post ,message can help with this scenario, but  I cannot get my head around how to make it work for this case.

Thank you,
HTMLJavaScriptjQuery

Avatar of undefined
Last Comment
APD Toronto

8/22/2022 - Mon