walls.corpus

By Nathan L. Walls

Articles tagged: web development

Browser currency

On August 1, 2011, Google is dropping support for IE 7 and several other browsers:

[S]oon Google Apps will only support modern browsers. Beginning August 1st, we’ll support the current and prior major release of Chrome, Firefox, Internet Explorer and Safari on a rolling basis. Each time a new version is released, we’ll begin supporting the update and stop supporting the third-oldest version.

Separately, Jason Rudolph of Relevance says of this:

Google finds it economically infeasible to support IE 6 & 7. You have less money than Google. Apply transitive law here.

What makes me happy about this is Google is giving web developers cover to drop older browsers. Imagine Google is the dollar. Web developers can in essence peg their currency to the dollar and move in lockstep with browser support. There is absolutely the possibility of getting a suboptimal result, but the upside looks really good. First, it gives predictability to your user base. Second, that user base is already likely to be motivated to stay on the bright side of Google’s support. Third, it’s a signal to management that the product has to keep moving forward to meet user expectations.

This absolutely doesn’t mean there won’t be hard work in keeping up with multiple browser versions, but it limits the pain by not having to support three rendering engines and three JavaScript interpreters for each browser a site supports.

IE and JavaScript MIME-type lessons

I’m a jQuery-fan and I recently wrote some forms for CrazyLikeThat using jQuery and AJAX. The goal was to use a Rails application I wrote as a service.

I hit a few roadblocks, though and in solving them, learned some things:

  • While ‘application/javascript’ may be the recommended type attribute to source in Javascript with the <script /> tag, IE doesn’t follow it. Regardless of what MIME-type your server sends JavaScript as, you have to specify ‘text/javascript’ to IE.
  • IE8 has three rendering modes, and there are implications for how to interact with the DOM based on which mode you’re in.

Apache Server Side Include directives for local web development

I’m developing some JavaScript to interact with a Rails service I have in support of CrazyLikeThat.com. I’m an infrequent jQuery developer, so I spend a lot of time in WebKit’s Web Inspector. I also use Google Analytics and Google AdSense. In the middle of looking at the Web Inspector console, I noticed a blizzard of warnings and errors from Google’s activity.

I remembered a few years back to some time at sacbee.com when one of the designers demonstrated Apache’s server side includes weren’t limited to including a page snippet or executing a CGI script, but included conditional logic. That’s precisely what I was after in this case.

I set an environment variable in my local Apache configuration then wrapped the conditional logic around my AdWords call and the Analytics JavaScript. In 10 minutes, I had a nice, quick solution to keeping the Web Inspector clean of anything other than my own errors.

So, what does this look like? My Apache directive is very simple. You’ll need both mod_include and mod_env enabled.

Then, on my pages, I do something like this:

When that NoAds environment variable is set, that file won’t be included. In production, it will be. My next approach on this will be to use different versions of jQuery based on environment. I can use a developer friendly version for my local development and use Google’s hosted jQuery in production. What’s really nice about this is with Apache 2.2’s chained handlers, I can use the same logic regardless of whatever’s building the page first, be it Rails, Template Toolkit or PHP.

Amazon Web Services, EC2 and Windows browser testing

My wife and I are launching a website in the near future. As part of the ongoing development process, we’d been talking about testing alternate browsers. We’re able to test Internet Explorer 6 on our machines using Darwine and ie4osx. Still, that left us without a great option to do IE7 testing.

As it happens, we have an older MacBook Pro 2.33 that fell off of Craigslist. We’d like to sell it, but Robin brought up using it as a Windows machine. I figured with Boot Camp and a Windows license, sure, we could be in business. However, with Windows XP or Vista licenses running between $120 and $300, I was eager to find an alternate solution. Bootstrapping a business means funneling money into product, not blowing the budget on something we’ll use infrequently. The tool can be essential, but infrequently used and thus, too expensive.

I remembered at work, one of our sysadmins set-up up some virtual machines to allow Linux and Mac OS X users to test on Windows XP. So, my thought was to use Amazon’s Elastic Computing Cloud (EC2) running Windows Server 2003. Handily, the machine images already use IE7. I fired up EC2 instances about four different times. At $0.125 per instance/hour and a little bit extra for Amazon S3 usage to load the image, our tests wound up at a whopping $0.52.

How I went about this:

There are other places I can take this, building a machine image with other browsers installed and storing the image on S3. In fact, that’ll probably making sense for us later this week.

There are other, largely unexplored options, mentioned here for future reference:

  • Browsershots A service that screen shots a site in several browsers.
  • litmus Free testing up to 50 times/month in FF2 and IE7. Or spend $24 for a day pass or get a month for $49. The tests give you screen shots and HTML and CSS validity reports. They do email testing, too.
  • CrossBrowserTesting.com

Screen shot services aren’t as useful because while you see what the page renders as, you don’t get a sense of what quirks a user will run into if, say, a JavaScript action fires differently. That’s the situation we’re in. The pages look fine, but don’t act like they should.