Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
  • #1357252

    I’d need an iframe full height, but did not managed to do it. Here is the the code I used on code block.


    Hey tammiviestinta,
    Thanks for posting your code block snippet, but your javascript has errors and the iframe had the height set to auto with inline css, below is the corrected script and the link to my test page.

    Best regards,


    It looks good on your test page. What is still have wrong here?


    It looks like the same code I posted, did you check to ensure that the quotes didn’t turn into curly quotes when you copied the code?
    Otherwise, I will need to see a test page to see if you have any errors, as you noted this is working on my test page.

    Best regards,


    Here is my testpage


    You have two errors, first your origin url is not wrapped in commas like the code I corrected above,
    you have: if(evt.origin !== return ;
    it should be: if(evt.origin !== '') return ;
    second error is that you are still using the jQuery statement for the iframe.height
    you have: iframe.height = ${}
    it should be: iframe.height =;
    So it looks like you are using the old code instead of the corrected code.
    If the code on your page backend is the new code I posted then you should try clearing your server cache, if it is an object-oriented cache such as Memcached, Redis, Varnish, Litespeed, etc. then it is still using the old page.
    Please review this code, note that the urls are not your so you will need to adjust.

    <iframe id="nw-kokonaistarjooma" style="width: 100%; border: none; margin: 0; padding: 0;" src=""></iframe>
    (function() {
    const iframe = document.querySelector('iframe#nw-kokonaistarjooma');
    window.addEventListener("message", evt => {
    if(evt.origin !== '') return ;
    if( {
    iframe.height =;

    Best regards,


    Thank you! Now it works great.
    – I try to learn this by myself but sometimes it is not easy… :D



    Great, I’m glad that Mike could help you out. Please let us know if you should need any further help on the topic or if we can close it.

    Best regards,

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.