Adding <script> asynchronously

Steve Souders comes up with what should be the definitive way to add script into a web page. This is particularly relevant to widget and third party code develoers.

Steve Souders comes up with what should be the definitive way to add script into a web page. This is particularly relevant to widget and third party code developers.

Part of the acceptance criteria for third party code in an e-commerce environment is its lack of impact on performance and other code in the page

The article appendChild vs insertBefore I hope will be part of a set of best practice conclusions from his P3PC series.

To augment your reading of this article it is also worth reviewing the information on browser “busy” indicators that was contained in the lesson Load Scripts Without Blocking from his CS193H Stanford class.

Based on the above, I tend to use XHR injection for local scripts to avoid the Firefox busy indicator and script DOM element insertion for offsite 3rd party code.

The state of e-commerce websites – Part 1: Overview

A big disclaimer up front – I am currently working for Williams-Sonoma which includes the Pottery Barn family of websites and West Elm. It is part of my role to look at front end performance with particular reference to the javascript.

I was surprised to find how many e-commerce sites are based around the Bay Area. From Walmart.com in Brisbane to Macys and Bloomingdales downtown.

Performance is an important aspect for e-commerce sites and so I thought it might be interesting to look at a group of them and compare speed, page weight, third party scripts and potential performance improvements.

In looking at the websites I want to look at 1) The home page, 2) a category / sub-category page and 3) A product page.

My first task was to get a list of the sites I want to look at. As I am working for a company taht has retail stores and also an online presence I thought it would be interesting to look at sites with a similar background.  The ones I chose are Macy’s, Bloomingdales, Sephora, Walmart.com, Crate and Barrel, CB2, Gap and Barnes and Noble. I have also added Amazon.com as a pure internet business to see if that makes a difference.

I am going to use a variety of methods to examine the sites – Initially I’ll use webpagetest.org to get some initial stats and I will also get the grades Google’s Page Speed and Yahoo!s YSlow Firefox plugins

For this post I have just gathered some basic information on the home pages of these sites. Home pages are generally the first page a user sees. and first impressions are important. However, in general, they are not necessarily reflective of the rest of a site and so I think should be treated differently.


All webpagetest.org tests were carried out with the following params From: Dulles, VA – 1.5Mbps ADSL using IE7

Updated 5/15/2010: Added Best Buy so we have a 10th clicks and mortar store

Welcome

Welcome to my latest home on the web. I thought I had better finally start using the domain name as I bought it some time ago.

Anyway, I am going to try and cover some performance stuff first – May take on WordPress and this blog initiallybut want to have a look at some of the eCommerce sites. I was surprised to learn of the number of eCommerce sites in the Bay Area – Even Walmart run WalMart.com from Brisbane just down the peninsula.

I suspect these best intentions may be superceded by whatever I am currently working on – Sharetivity (And hence appMail) are in the process of moving from OpSource to Fujitsu with ExoIs

Also, I am currently rolling my own minimalist JS library from jQuery and Dojo to reduce the size of JS being loaded on most pages in the WSI mobile sites.