Hi,
I need to add EspoCRM to an Iframe. I will have to deal with an Iframe Cross-Domain code so that I can read the height in pixels of the EspoCRM generated HTML.
My requirement is to add a custom Javascript code to all pages of EspoCRM.
I would like to add this code at the end of the EspoCRM html:
How can I do this?
Best Regards,
André Lopes.
I need to add EspoCRM to an Iframe. I will have to deal with an Iframe Cross-Domain code so that I can read the height in pixels of the EspoCRM generated HTML.
My requirement is to add a custom Javascript code to all pages of EspoCRM.
I would like to add this code at the end of the EspoCRM html:
Code:
// Cross-domain iframe Height function inIframe(){ if(top != self){ var contentHeight = $('#no-more-tables').height(); //Just this part I did with jQuery as I was sure that the document uses it postSize(contentHeight); } } function postSize(height){ var target = parent.postMessage ? parent : (parent.document.postMessage ? parent.document : undefined); if(typeof target != "undefined" && document.body.scrollHeight){ target.postMessage(height, "*"); } } inIframe();
Best Regards,
André Lopes.
Comment