Absolutely bizarre appendTo problem in IE 8
The following code works great in almost everything (variable names changed):
this.$something.appendTo($container);
But in IE8, it was just... not doing the append. No error. No warning. Not a whimper. Through sheer luck, we found something that worked for no discernable reason:
$('<div class="hideme">ihat开发者_C百科eIE</div>').appendTo($('body')).remove();
this.$something.appendTo($container);
It's not a timing issue - there's no setTimeout involved and all the variables are either created right then or have been around for a while. And it works no matter what you append, no matter where you append it to, as long as you append SOMETHING to SOMETHING.
Why, why, why, why, why? I hate leaving this hack in my code.
精彩评论