The problem is that insertBefore() on Win7/IE10 crashes if the second parameter is undefined, rather than behaving as if the parameter is missing, as all other browsers do. Aaargh.