I wonder if anyone could help with a problem that appears to have defeated me? I am bringing back an HTML clip from the Twitter oEmbed API.
It seemed to me that am HTML Embed was an ideal way to deal with this as I want to be able to show embedded tweets based on my API requests.
I have the API working fine and delivering back the clip wrapped as a blockquote. Following the instructions on the Twitter developer site I copied the javascript that takes the blockquote and renders it as an an embedded tweet.
So far so good. I am now attempting to I assume populate the body of the embed with the returned data request from the API so I am using
$w ( “#html1” ). postMessage (t witterData );
The problem appears to be that the javascript required to read the data may be clashing with the above script
If I manually past the returned twitter html clip, the tweet immediately renders exactly as expected. However when I try to use code to populate what I assume to be the body text, it fails
I’m looking for a way to populate the embed body as if I had pasted in the content.
This code as recommended in the Wix documentation
< script type=“text/javascript”>window.onmessage = (event) => { if (event.data) { let receivedData = event.data; } }; //… </ script >
does not play well with the first script.
Thanks in advance