Gary Haran.com


Montreal StartupDrinks Tonight

Posted in garyharan.com, Programming by gary.haran on the April 30th, 2008

I’m headed to the unfortunately named event tonight where people having an interest in startups or entrepreneurship can meet up for a drink (and not where non-drinkers can take up drinking).

Send me a twit/shout/email if you’re going.

PS: you may have noticed that I caved in and am now using Twitter.

Internet Explorer cannot open the Internet site: Operation Aborted

Posted in Programming by gary.haran on the April 22nd, 2008

This is perhaps the most dreaded of all Internet Explorer errors. It’s shrouded in mystery as even the ancient Microsoft Script Debugger cannot help you deal with it.

Operation Aborted

Working example

If you have Internet Explorer 7 give it a shot and see your operation aborted error in all it’s glory.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
  <head>
    <title>Internet Explorer cannot open the Internet site: Operation Aborted.  Sample error.</title>
  </head>
  <body>
    <table>
      <script>
        document.body.appendChild(document.createElement('div'))
      </script>
    </table>
  </body>
</html>

Why it fails

Internet Explorer doesn’t like scripts appending elements to the existing DOM, especially when the script tag is inside ul, ol, table, form, blockquote, and various other tags…. When Internet Explorer fails it fails spectacularly by shutting down the script engine and aborting page rendering.

Solution(s)

One way to circumvent the error is to wait till the entire page DOM has been rendered. You can do that with window.onload or if you prefer using Prototype Javascript Framework you can get away by launching the DOM operation with dom:loaded.. jQuery has the ready method but numerous frameworks come with their own implementation.

Here is the sample solution to the internet explorer operation aborted using window.onload.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
  <head>
    <title>Internet Explorer cannot open the Internet site: Operation Aborted.  Error: sample solution.</title>
  </head>
  <body>
    <ul>
      <script>
        window.onload = function(){
          document.body.appendChild(document.createElement('div'))
        }
      </script>
    </ul>
  </body>
</html>

GitHub Launched!

Posted in Uncategorized by gary.haran on the April 10th, 2008

GitHub launched!

With Rails moving to Git you may want to jump on the band wagon too.

If you are using OS X I recommend you check out Djief’s blog to learn how to install Git on OS X.

Happy committing!

Is Front-End Your Weakest Link?

Posted in Uncategorized by gary.haran on the April 9th, 2008

Today, a rails programmer can write the back-end of a web application without ever opening a browser. With well-written functional tests there is no need to do verify your work in the browser. In theory you could deliver a fully tested application to a front-end programmer and he could build the proper views to deliver your application to the masses.

What really irks me is how some players in the industry disseminate the myth that front-end development can be an after-thought. Hearing a manager say that cheap code-monkeys could do the front-end part is a good way to put your entire application in jeopardy.

What I propose is that people stop making it sound like back-end is more important than front-end. They both are and if you ignore either one of them it doesn’t matter how good the other is.

A web application is a chain where the back-end and the front-end are links between your business and its users. If your users see a crappy front-end you will never say “Well at least the back-end is sound”.