New script file: append or write?
Following my last post about OAT's dynamic loading, I have to mention how is the script inclusion actually implemented. The task is easy: add a new script to already loaded HTML document. You have two basic options:
  1. document.getElementsByTagName("head")[0].appendChild()
  2. document.write()
OAT uses number one. Not only it is more aesthetic and native DOM approach, but it also works. Compare with Google Maps API or Yahoo Maps API: I created these two demopages (google, yahoo) which show how document.write() puts Firefox into endless loop. No, thanks. The same applies to Microsoft's Virtual Earth. The only correctly implemented mapping engine is OpenLayers.

Remark: of course, when used in classical way (in document's head during page load), these APIs work fine. I am talking about non-standard, delayed, inclusion.

Now one can ask why document.write() applied to loaded page freezes Firefox? Easily! First of all, this resets contents of whole page (so it gets blank); second, there is no document.close(), so page remains opened for writing forever. Pretty ugly stuff.

For your information, I have notified both Google and Yahoo developers about this, multiple times. Noone has ever bothered to respond!