>>IE completely refuses to load the page at all, instead alerting me about something like "can't display this page", so quite impossible to debug.
This sounds like the weird bug in IE when you modify the dom before the page is ready. Something on msn developer about this.