Serving the Flathead Valley & Montana since 2006. A reality based independent journal of observation & analysis. © James Conner.

 

18 October 2013

An HTML coder looks at John Lewis’ campaign website

lewis_150h

Unlike most bloggers, I write the HTML code for my website, a practice that sometimes leads me to look at the source code of other websites. So when John Lewis formally announced his candidacy for the Democratic nomination for Montana’s seat in the U.S. House of Representatives, and his campaign’s website became fully operational, I looked at his website’s source code as well as its content. That led to an investigation I hadn’t intended to make, to the table below that summarizes its results, to a code snippet inconsistent with his born in Montana to run for Congress theme, and to confirmation that he’s using open source software, a good thing.


An inconsistent snippet

Let’s start with the snippet:

lewis_country_code

Line 1 is the Document Type Declaration. Here, it’s telling your browser to render the page in HTML5, the latest version of the Hypertext Markup Language. That’s standard.

But what follows on Line 2 is not standard for political websites in the United States. Line 2 is the web page’s opening HTML tag (tags are enclosed in inequality signs — < > — and have attributes that have values) that’s the document’s root and container for the rest of the HTML elements. Here the interesting attribute/value combination is xml:lang="en-gb" lang="en-gb, which specifies that the page’s primary language is English. British English:

country_code_explanation

What this means in practical terms is that if a computer is set up to read the page aloud, which it might be for people with very poor eyesight, it may well be read in English with a British accent. The only Montanans for whom that accent would be native are English remittance men, if there are any still living in the state. The GB country code has to be an error. I wonder whether Lewis’ Washington, D.C., based website developers adapted for Lewis a website they’d written for a client in the United Kingdom and forgot to change the country code.


Open source content management

Joomla is the world’s second most popular open source content management system; first is WordPress, the favorite of many bloggers. According the the Wikipedia, Joomla “…is the anglicised spelling of the Swahili word jumla meaning ‘all together’ or ‘as a whole’ which also has a similar meaning in at least Arabic and Urdu.” It’s a good choice for Lewis’ website, which is rife with cookie planters and other code to track visitors.


Google Pagespeed scores

Google provides webmasters with numerous tool, among them Google Pagespeed, which measures a web page’s loading efficiency. The scale is 0–100, and the higher the score, the better. A Pagespeed score is not always a proxy for a page’s loading speed — a huge page with a high efficiency score may load more slowly than a small page with a low efficiency score — but a high Pagespeed score does confirm good coding practices. I loaded Lewis’ home page into Pagespeed and got a smartphone (mobile) score of 56 and a desktop score of 74, slightly better than the scores for Jon Tester’s home page. For a comparison, I tested several more campaign website, and some Montana blogs and the federal healthcare exchange home page. The results are below.

Lewis’ page loads slowly for me. The chief culprits? A huge, distracting, and utterly gratuitous background image and a 90-second video. I think the page tries to do too much. I’d pare it down, starting with that big background image and the video. I’d do the same for Tester’s page, which I suspect was coded by the same people.

And the healthcare.gov home page? It’s pretty efficient, although the website still crawls with bugs.

Google Pagespeed scores

CandidateTypeOperational StatusMobileDesktop
Matt RosendaleCandidateFull6786
John WalshCandidatePartial6383
John LewisCandidateFull5674
Steve BullockPoliticianFull5770
Jon TesterPoliticianFull5469
Steve DainesCandidateFull5364
Corey StapletonCandidatePartial4658
Bill LaCroixBlogFull7888
Flathead MemoBlogFull6482
4 & 20 BlackbirdsBlogFull6879
PolymontanaBlogFull5971
Montana StreetfighterBlogFull5568
Intelligent DiscontentBlogFull5265
Montana CowgirlBlogFull5764
From Eternity to HereBlogFull6162
Western WordBlogFull6760
MEIC EnergyBlogFull2838
Montana RepublicansPartyFull6185
Flathead DemocratsPartyFull6080
Montana DemocratsPartyFull6274
Flathead RepublicansPartyFull3042
Healthcare.govGovernmentBuggy6180