Board Thread:Support Requests - Getting Technical/@comment-188432-20130522205157/@comment-452-20130522215242

.stuff means class="stuff"
 * 1) stuff means id="stuff"

Just to be clear, do you want to add prepend styles to a class, or prepend content to all containers using that class?

I'm guessing the second one, and will provide the answer to that.

One way to do it in css is: .stuff:before { content: "look at me, inserting content with css!"; }

But you did ask about javascript, so: $(".stuff").each( function { //loop through each class     this.prepend('here's where the content goes. ');  });

But you asked about loading from a template.

Loading a template with javascript is definitely getting technical, but I know of at least one widely used script which does that already.

Take a look at http://tardis.wikia.com/wiki/MediaWiki:Common.js search for "Template:Stdsummaries"

That section of code loads Template:Stdsummaries and inserts it, line by line, into the standard summaries dropdown, so you should be able to copy/paste what you need from there. :)