@julian Exactly. It's just not feasible and would cause significant strain even with lazy loading. It's why I've opted for 2nd best, which is the "cosmetic" route meaning certain posts (for example, your own, and topic-owner) stand out.
@baris @julian found a much simpler way to do this
<script>
if (!window.jQuery) {
window.addEventListener('load', function() {
$(document).ready(function() {
$("#resolved").appendTo('[data-index="1"]:first-of-type');
})
})
} else {
$(document).ready(function() {
$("#resolved").appendTo('[data-index="1"]:first-of-type');
})
}
</script>
@dunlix yeah you should!
what does discord have to do with it? I tried using that link with different values and URL of course on my site, still didn't work. I'm sure it works for you, what am I missing?
To be honest: Nothing.
I am building a plugin for Discord integration..So the variable names are just placeholders if you want so.
The important part is at the end of my main post.
I hope that you find a slick way to use it for your community maybe.
in the client, those values are stored in ajaxify.data
For your jQuery, you don't append a closing tag, it does that automatically. When you want to insert the element into the div, you need to use appendTo(). Also, unless your label has additional data, I recommend using html() instead of text().
Here's a fiddle. I also added an ID to the new label so it isn't added more than once.
https://jsfiddle.net/bdLgsj7p/