FireFox 3.0 and Hosts Files

FireFox logoI discovered something interesting today: FireFox 3.0.X periodically reloads your hosts file while running.

I'd been using IE7 and Chrome when working with my code recently, but today I'd had a Chrome specific bug and fired up FF as a double check. While it was running I needed to view something on the unmodified version of a URL I'd overridden, so opened my hosts file, updated it and then launched a new browser to check out the other version. After about 5 minutes I refreshed the FF page, and suddenly I get a warning that the file doesn't exist. At first I thought I'd deleted something, but it turns out that FF update from the host and was now requesting the site where the file didn't exist, instead of my development version.

I reverted my host file and refreshed for a bit, and sure enough, suddenly it switched back to the development version. As far as I'm aware, FF3 is the only browser that updates its host file while running; every other browser seems to only load it on start and then to hold onto that result.

 

Prototype.js on IE smashed by id="tblStudents"

Ok, so here is the weirdest IE bug I've ever seen.... the weirdest by far. I was trying to get some sortable table code up and running and after I got it going in FireFox, IE 7 was throwing fits. I narrowed it down to a specific instantiation of the table that I had on my page, and then started hacking things out. I pulled out all my custom DisplayTable code. I remove all of my custom code completely. I removed Scriptaculous.

Turns out IE has a weird behavior where it adds a global scope variable with the same name as any id, so that you can just say tblStudents.innerHTML = 'whatever' without needing to fetch the element. My lack of a var keyword before my variable ment it was trying to reference that variable and causing a conflict.

 
Jon Hartmann, July 2011

I'm Jon Hartmann and I'm a Javascript fanatic, UX/UI evangelist and former ColdFusion master. I blog about mysterious error messages, user interface design questions, and all things baffling and irksome about programming for the web.

Learn more about me on LinkedIn.