Website Loads Twice Unnecessarily

As I’ve found, this happens when your html, css or javascript tries to load a resource and you haven’t specified a path or wrongly specified root.

For instance, I’ve seen examples on people having this problem while doing

<img src="http://example.com" />

background:url();

In my case specifically, was assigning $.ajax() to a global variable so I could work with it later, like this

var map_markers = $.ajax();

clearly I don’t know enough javascript, regardless, this $.ajax() was causing the site to load twice.

Hope this helps someone googling. If you suspect this is happening, http://tools.pingdom.com/ will show you what loads in your site.

Leave a Comment