I am trying to embed a reddit widget into my qualtrics survey and it is working fine, but I don’t like that the widget by default doesn’t show the full post and has a “read more” button (see image) . It barely shows any of the post as is. Is there a way to render it without the “Read More” button?
Here is my Qualtrics Javascript and HTML code:
HTML:
<div id="embeddedPost3">
<blockquote class="reddit-embed-bq" data-embed-height="316" id="redditBlockquote3" style="height:316px"><a href="" id="redditLink3"></a></blockquote>
</div>
Javascript:
Qualtrics.SurveyEngine.addOnload(function()
{
/*Place your JavaScript here to run when the page loads*/
});
Qualtrics.SurveyEngine.addOnReady(function()
{
var url_1c = "https://www.reddit.com/r/webdev/comments/134ldxr/recommended_way_to_embed_reddit_posts/"
var platform_1 = "reddit"
// Set the href attribute of the blockquote anchor tag
if (platform_1 == "reddit") {
const redditLink3 = document.getElementById('redditLink3');
redditLink3.href = url_1c;
let s = document.createElement("script");
s.src="https://embed.reddit.com/widgets.js"
document.body.appendChild(s);
}
});
Qualtrics.SurveyEngine.addOnUnload(function()
{
/*Place your JavaScript here to run when the page is unloaded*/
});
Chatgpt mentioned I can simulate a click on the “read more” button after it renders, but is there any better way? I’m just a bit worried about how stable that is as a solution depending on how the screen loads.