开发者

Absolutely bizarre appendTo problem in IE 8

开发者 https://www.devze.com 2023-04-07 21:18 出处:网络
The following code works great in almost everything (variable names changed): this.$something.appendTo($container);

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消