How to load comments dynamically on a JS app?
By Dashamir Hoxha @dashohoxha
I have an app whose content is updated with JS (AJAX). I would like the comments to be updated too when the content is updated. First of all, I can use a data-discussion-id
to specify the comments that should be loaded. But I don't see how to refresh or reload the comments.
Currently the comments are in disqus and the implementation looks like this:
- https://gitlab.com/b-translator/vocabulary/-/blob/master/html/_html/disqus.html
- https://gitlab.com/b-translator/vocabulary/-/blob/master/js/_app/disqus.js
-
https://gitlab.com/b-translator/vocabulary/-/blob/master/js/_app/translations.js#L89-93
Any idea about how to do the same thing with TY?
- Dashamir Hoxha @dashohoxha
Never mind. I found some way to make it work:
- https://gitlab.com/b-translator/vocabulary/-/blob/master/html/_html/talkyard.html
-
https://gitlab.com/b-translator/vocabulary/-/blob/master/js/_app/talkyard.js
I am not sure if this is the best way, and I see some error messages on the console, but it seems to work anyway.
- Progress