开发者

$("#my_div").html('value'); not replacing in IE7

开发者 https://www.devze.com 2022-12-11 11:24 出处:网络
I\'m u开发者_开发百科sing a simple JQuery call to replace some HTML in a DIV tag after an AJAX call.

I'm u开发者_开发百科sing a simple JQuery call to replace some HTML in a DIV tag after an AJAX call.

$("#my_div").html('value');

This works great in the other browsers, but in IE it is just adding to the DIV instead of replacing the HTML.

Any ideas why that would happen?


call empty() before html()

$("#my_div").empty().html('value')

I noticed that behavior quite a lot and empty() always fixes the issue.

0

精彩评论

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