Thread:Self-Proclaimed King/@comment-32188346-20190116025741/@comment-28994028-20190323010529

Oh hi. Thanks for asking. Regarding your partnership offer, I will have to turn it down. Sorry. Anyway, about the Reddit Feed, I took it from another wiki that I stumbled upon, and yes, it involves Javascript.

You see the following script I placed on my common.js:

/* Any JavaScript here will be loaded for all users on every page load. */ /* ================================================== */ /* ====  Reddit Widget                          ==== */ /* ================================================== */ $(document).ready(function {   var enableWidget = document.getElementById("reddit-widget");    if (enableWidget)    {        // Reddit cannot be loaded through appending script tag as homepage has scripts that interferes with reddit script        var redditWidget = document.createElement("iframe");        redditWidget.width = "100%";        enableWidget.appendChild(redditWidget);        // Add the script         redditWidget.contentWindow.document.write("       ");        // Readjust height based on how much content reddit widget has        var tryReadjust = setInterval(function {           // Take contents of iframe out and put it on page (lol) // Otherwise page keeps loading (for some reason), and cannot be clicked because Reddit // set X-Frame-options to SAMEORIGIN var t = redditWidget.contentDocument.children; t = t[0].getElementsByClassName("rembeddit")[0]; if (t) {               // Have to wait until element exists before taking it out document.getElementById("reddit-widget").appendChild(t); redditWidget.remove; clearInterval(tryReadjust); }       }, 1000);    } }); You then visit Template:RedditFeed to see how it's implemented.