Forum:Code to add sitewide counter

After reading http://community.wikia.com/wiki/Forum:Need_help_adding_counter_to_all_pages I decided it was time to go ahead and add that sitewide counter that I've long been thinking of.

The sitemeter website says I need to add

  

to every page so I added

@import url("http://s21.sitemeter.com/js/counter.js?site=s52ReligionWiki&action=raw&ctype=text/css"); $(function($) {	$(document.body).append('  '); });

to the sitewide js page.

It doesnt seem to be working.

Did I do something wrong?

Granpa (talk) 14:25, August 17, 2012 (UTC)


 * OK, so I changed it to

 importScriptURI("http://s21.sitemeter.com/js/counter.js?site=s52ReligionWiki&action=raw&ctype=text/javascript");


 * and at first glance it looks like that might be what it needed
 * Granpa (talk) 16:22, August 17, 2012 (UTC)


 * The counter is loading and appears to be functioning perfectly and so is the javascript.
 * Maybe I'll write a "how to" over at the how to wiki.
 * Granpa (talk) 02:14, August 19, 2012 (UTC)


 * I went ahead and created a how to here:http://www.wikihow.com/Add-a-Counter-to-Your-Wikia-Wiki
 * I would appreciate it if someone would double check it for me
 * I'm pretty sure that ctype=text/javascript is a mistake.
 * Granpa (talk) 02:54, August 19, 2012 (UTC)

importScriptURI; is deprecated. Try using the jQuery alternative $.getScript("link"); .TK-999 (talk) 09:48, August 19, 2012 (UTC)


 * The  is redundant. You only need to add that for JS files on a MediaWiki site (which sitemeter isn't).


 * And the code that adds the image to the page isn't needed either. The image is meant for people who don't have JavaScript enabled, so adding it through JavaScript won't give the correct result. - Tjcool007 (Talk) 10:12, August 19, 2012 (UTC)