This Forum has been archived

Visit the new Forums
Forums: Index Support Requests Code to add sitewide counter
FANDOM's forums are a place for the community to help other members.
To contact staff directly or to report bugs, please use Special:Contact.

50px-Replacement filing cabinet.svg

Note: This topic has been unedited for 2129 days. It is considered archived - the discussion is over. Do not add to unless it really needs a response.

After reading 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

<!-- Site Meter -->
<script type="text/javascript" src="">
<a href="" target="_top">
<img src="" alt="Site Meter" border="0"/></a>
<!-- Copyright (c)2009 Site Meter -->

to every page so I added

@import url("");
$(function($) {
	$(document.body).append('<div id="counter"><a href="" target="_top"><img src="" alt="Site Meter" border="0"/></a></div>');

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
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:
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)

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

The &action=raw&ctype=text/javascript 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)
i'm using MediaWiki and should i add it in here = Tiny Village Wiki ?
basicly since i use mediawiki, do i have to use the &action=raw&ctype=text/javascript ??? WieQuadrat (talk) 15:11, August 19, 2012 (UTC)