View Full Version : Strange load times: is it my Javascript?

07-02-2012, 02:27 PM
I'm messing around with an image sharing site: www.giffrey.com

I've noticed two things:

1. The nav bar loading favicon reloads on each refresh at a pretty slow rate. It tends to finish load when the .gif has fully loaded. I assume that isn't a coincidence.

2. The stumbleupon button, which is javascript based, does the same thing - it doesn't load until the .gif is finished.

I imagine both problems are one and the same. Can anyone shed any light on what might be causing the issue? The aforementioned scripts are below:

<script type="text/javascript">
(function() {
var li = document.createElement('script'); li.type = 'text/javascript'; li.async = true;
li.src = 'https://platform.stumbleupon.com/1/widgets.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(li, s);

<script type="text/javascript">

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-33036980-1']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);


Thanks in advance!

07-04-2012, 08:03 PM
Everything on a page is displayed in the order it's loaded. Load times vary especially if you're retrieving items from other servers/websites. It's their server response that slows things down mainly due to the number of visitors and other websites trying to access their information the same way. Example "google-analytics" millions are trying to pull info from their servers during high traffic times which causes some sites to load slower than others. The caller may have to wait until server is available.