Hello Chess.com,
While creating my website, which serves as a blog about chess, I encountered an issue with embedding a game diagram on the page.
When we try to share a game by clicking Share >> Embed and copying the generated code, the <iframe> tag is missing the https or http protocol. This makes it impossible to properly embed the code on the website.
What is the <iframe> tag?
The <iframe> tag in HTML is an element used to embed another webpage or resource within the current page. This allows content from another URL, such as a video, map, document, or interactive elements, to be displayed in the browser window.
Structure of the <iframe> tag:
<iframe src="https://example.com" width="600" height="400" title="Example iframe"></iframe>
The src (source) attribute of the <iframe> tag is its most important element. If we enter an incorrect link, the entire tag won't work.(It's like trying to play chess on Chess.com by typing a link with a typo in the browser, which will prevent Chess.com from loading.)
Below, I present the behavior of the incorrect code.
Result:
As we can see in the example above, the generated code is without protocols, only the // characters are present. Below, I present the corrected and properly working code.
Result:
Finally, I would like to mention that simply removing the // characters before the link on Chess.com will not fix the issue; the code will still not work properly.Thank you for reading.