![]() Naming means making sure you trust the source. dangerouslySetInnerHTMLĭangerouslySetInnerHTML is required to render this HTML content within a React application correctly, or else any markup embedded in that string will not display. It is required to adjust the sizes of the iFrames correctly and to handle other events. ![]() You’ll need to add embed.js script to your page yourself. ![]() When you &omit_script=1, Iframely omits our own embed.js too. You’ need to run Iframely’s loader for each of your elements see next. If the layout shift is not a concern, please read this approach embed.js documentation. There is also an option to create HTML templates and skip API calls altogether. If you absolutely need to make API calls from the client, please send requests to the CDN shield /api/…, or via your own CDN distribution. See our general recommendation for server-side API calls to oEmbed or Iframely API and serving the HTML from your cache. Run Iframely’s loader for each element if needed.įetching of HTML code can be done in multiple ways.Otherwise, the HTML markup will not display properly. Use dangerouslySetInnerHTML to properly render rich media HTML content within your React application.Add our embed.js as a single third-party script for correct iFrame sizing.The parameter will make sure that your HTML codes link only to iFrames, native or Iframely-hosted.For this, add &omit_script=1 parameter to your API requests.The fix involves putting all rich media that requires it into a hosted iFrame.The approachĪssuming you get your HTML codes from us via API calls: It is a single script that to make an exception for and add to the page yourself. The issue affects any scripted third-party rich media such as Twitter, Instagram, Facebook, TikTok, Imgur and GitHub Gists, and Iframely interactives - summary cards and lazy-loaded players.īecause we still need to listen to the control events posted by iFrames, we provide our embed.js script. This guide will provide React-specific instructions only. Please read details about innerHTML issue and our suggested general solution for it in our &omit_script=true guide. It means that rich media from publishers like Twitter, Instagram, Facebook and TikTok will not work out-of-the-box and require a hosted iFrame. Per HTML5 specification, any tag is ignored.
0 Comments
Leave a Reply. |