Using jquery getScript in onload function seems to break statcounter

Discussion in 'Help' started by terraling, Apr 30, 2012.

Tags:
Thread Status:
Not open for further replies.
  1. terraling

    terraling New Member

    Joined:
    Apr 30, 2012
    Messages:
    1
    Likes Received:
    0
    Hi

    I've been using the normal statcounter code on my site no problem for a long while, but I've trying to take a more hands on approach to managing the pageload, and I don't want statcounter to load until the end.

    So I have an window.onload function which includes a jquery call to pull in the statcounter script

    Code:
    	//Load statcounter code
    	var sc_project=6556413; 
    	var sc_invisible=1; 
    	var sc_security="xxxxxxx";
    	$.getScript('http://www.statcounter.com/counter/counter.js'); 
    Should be fine, I think, but I'm not seeing any activity in my statcounter pages (from computers that don't have the cookie to exclude my own visits).

    Does anyone recognise why this might not be working?

    Thanks for your help.
     
Thread Status:
Not open for further replies.

Share This Page