• Resolved ottomatek

    (@ottomatek)


    I’m trying to insert chess analysis/puzzle embeds onto my website from chess.com and lichess.org. I’ve tried doing it several different ways. The first was just simply pasting the code into the block editor which tried converting it but told me that it could not be embedded. Next I tried pasting the code with the classic editor and it simply displayed the pasted code on the post page. Lastly, I added an html box on the block editor and inserted the code into that. This caused the following error — Updating failed. The response is not a valid JSON response — so it doesn’t allow me to publish the post because of this. However, what I am trying to embed does show up in the html text block on the editing page when I preview it there. The preview on website page, though, obviously does not work. How can I fix this?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Moderator threadi

    (@threadi)

    Could you please name the exact code you tried to insert?

    Thread Starter ottomatek

    (@ottomatek)

    <iframe id=”9286423″ allowtransparency=”true” frameborder=”0″ style=”width:100%;border:none;” src=”//www.chess.com/emboard?id=9286423″></iframe><script>window.addEventListener(“message”,e=>{e[‘data’]&&”9286423″===e[‘data’][‘id’]&&document.getElementById(${e['data']['id']})&&(document.getElementById(${e['data']['id']}).style.height=${e['data']['frameHeight']+30}px)});</script>

    Moderator threadi

    (@threadi)

    It works fine for me if I put it in an HTML block. However, the <script> code is not necessary at all, I don’t see that described at http://www.chess.com either.

    Warning: since you posted the code here unformatted, I’m also unsure if the code is completely correct that way. I have used the following:

    
    <iframe id="9286423" allowtransparency="true" frameborder="0" style="width:100%;border:none;" src="//www.chess.com/emboard?id=9286423"></iframe>

    Why this doesn’t work for you could be due to individual settings on your project. A link to the page where you inserted the code could help.

    Thread Starter ottomatek

    (@ottomatek)

    Ah. So all I had to do was remove the last part of the code. I see. That was the code that chess.com gave me, and I was trying it with the script part. It works now, however, it’s confined within a small box that I need to scroll through to reach different parts of the board. Is there an easy solution to get rid of this so that the whole board is viewable all at once? I’m not sure if this was how it was for you as well, but you might understand what I mean if it was.

    Moderator threadi

    (@threadi)

    The JavaScript part could provide exactly this height. Since you posted it here unformatted, as I said, I can’t judge what’s wrong with it, so that doesn’t work for you. My recommendation would be that you contact chess.com to clarify the correct format for this.

    Alternatively, you can set the height of the iframe in WordPress yourself via CSS. Check how high the iframe should be and add the CSS code in the source code. An example (untested):

    <iframe id="9286423" allowtransparency="true" frameborder="0" style="width:100%;border:none;height: 500px" src="//www.chess.com/emboard?id=9286423"></iframe>

    Thread Starter ottomatek

    (@ottomatek)

    Yes! That did the trick. Thanks a bunch!

    Hi! I’m working on a project for my friend who is a Realtor and I’m building her site in Divi. My site is Elementor. I should have told her to stick with this. Anyways, I’m having to put iframes into her webpage. Her association of realtors sent 8 pieces of code to insert into her site. The first one works fine; however the second one and thereafter, does not. Here are my codes with her personal info left off:

    src=”https://ppar.com/frameset/links/linked_res.aspx?&#8221; name=”Search Residential Listings” height=”760″ width=”1050″></iframe> <iframe> margin-width Attribute: “50” </iframe> (This code seems to work)

    <iframe src=“https://ppar.com/frameset/links/linked_lnd.aspx?” name=”Search Vacant Land” height=”760″ width=”1050″></iframe> <iframe> margin-width Attribute: “50” </iframe> (This code doesn’t)

    <iframe src=“https://ppar.com/frameset/links/linked_ren.aspx?” name=”Search Rentals” height=”760″ width=”1050″></iframe> <iframe> margin-width Attribute: “50” </iframe> (This code doesn’t work either and the four after doesn’t as well)

    Also, they’re supposed to look like “thumbnails” but they don’t. These are the measurements they’ve submitted and the images look pretty big. What am I doing wrong? Thanks for any help you can give me.

    Moderator threadi

    (@threadi)

    Please create your own topic in the forum for your question: https://ww.wp.xz.cn/support/forum/how-to-and-troubleshooting/#new-topic-0
    However, since you are talking about Divi, your question would be better addressed to their support. Commercial products are not supported here in the forum.

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Can’t Embed iFrames’ is closed to new replies.