0

After visiting a lot Stackoverflow for the past years, I am now decided to ask a question.

I am using Mailchimp to send newsletters, and WordPress to publish articles and e-commerce. I found a way, using Zapier or Automate.io, to publish new newsletters to the website and feature them seamlessly.

But I had to define the webpage height of the iframe. However, this height changes from one newsletter to another.

The process is the following :

The newsletters is published on Mailchimp > The campaign URL is then added to a pre-configured iframe script > The whole is published in a new article on WordPress.

I read a lot about iframe javascripts or jquery, but I am obviously not able to add content or scripts in a Mailchimp archive page.

I am able to add a Javascript or Python code between the steps to output the page height, can this be a solution, and how can I manage to do this ? Also, can I had a script to the Wordpress pages to calculate and populate the iframed page height ?

Regards,

bthv1
  • 1
  • 1
  • No, this can't be done, unless you would get some active help from the remote party (resp. be able to insert your own scripting logic there, which you said you can't.) The Same Origin Policy prevents you from accessing the content of the iframe via client-side scripting, so you won't be able to measure the height of its content. – CBroe Aug 26 '21 at 10:44
  • You should check iframes alternatives, because as mentioned by CBroe, you cant get the height of an iframe page. You can have a look at this: https://stackoverflow.com/questions/8702704/alternative-to-iframes-with-html5 – Jiří Vítek Aug 26 '21 at 10:50
  • Thanks, I am happy to be sure now that it isn't possible. – bthv1 Aug 26 '21 at 16:25

0 Answers0