jQuery, html5, append()/appendTo() and IE

前端 未结 5 1143
鱼传尺愫
鱼传尺愫 2021-02-02 01:17

How to replicate:

  1. Create an html5 page.

  2. Make sure you have the script from remysharp.com/2009/01/07/html5-enabling-script/ added so that IE wi

5条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-02 02:11

    Does the HTML5 shiv handle innerHTML? IE very likely treats innerHTML differently than DOM methods like createElement, and reading the jQuery source (which I recommend), it seems your code is triggering innerHTML instead of the DOM methods. You might try rewriting

    as
    (which at first glance should trigger DOM methods in the cleanup process) and see if it behaves differently. If so, you've identified a bug in jQuery and a limitation of the HTML5 shiv. If not, at least it's one possibility to cross off.

提交回复
热议问题