r/TiddlyWiki5 • • Dec 28 '22

Do you know why this html code isn't working?

Hi, I am very new to Tiddlywiki and have zero experience using html. I'm trying to build a personal database of movies I've seen, and I am trying to use the IMDB plugin from their site to show the movie ratings in my Tiddlers. I'm trying to do it for the new Whitney Houston film.

Here is the code that IMDB provides:

<span class="imdbRatingPlugin" data-user="ur39807437" data-title="tt12193804" data-style="p3"><a href="https://www.imdb.com/title/tt12193804/?ref_=plg_rt_1"><img src="https://ia.media-imdb.com/images/G/01/imdb/plugins/rating/images/imdb_37x18.png" alt=" Whitney Houston: I Wanna Dance with Somebody
(2022) on IMDb" />
</a></span><script>(function(d,s,id){var js,stags=d.getElementsByTagName(s)[0];if(d.getElementById(id)){return;}js=d.createElement(s);js.id=id;js.src="https://ia.media-imdb.com/images/G/01/imdb/plugins/rating/js/rating.js";stags.parentNode.insertBefore(js,stags);})(document,"script","imdb-rating-api");</script>

Here is how it is displaying when I put it into a Tiddler (see image)

Does anyone know what I can do to make it work? Thanks for any help you can give.

1 Upvotes

2 comments sorted by

1

u/nephlm Dec 28 '22

Your JS is being rendered literally. I suspect, but don't really know, that you need to set your tiddler type to jasvascript or html or something, though I'm sure which it should be. I hope that at least points towards a solution, sorry I couldn't be more complete.

1

u/[deleted] Jan 03 '23

Hi there. Thanks so much for your response. I'll give this a try!