次のコードは他のブラウザーではうまく機能しますが、IE7および8ではそれについて文句を言います。
var divs = $(".paginate-boxes li");
for(var i = 0; i < divs.length; i+=9) {
divs.slice(i, i+9).wrapAll("<li class='slide-portfolio'><ul></ul></li>");
}
それが取り組んでいるコードは、li
次のような長いリストです。
<li>
<!--Fade-->
<div class="mosaic-block fade">
<a href="http://www.example.com/destination/" class="mosaic-overlay">
<object class="details">
<h4>Destination Page</h4>
<p>
</p>
</object>
</a>
<div class="mosaic-backdrop"><img width="296" height="175" src="http://www.example.com/wp-content/uploads/this_thumb.jpg" class="attachment-portfolio-image wp-post-image" alt="this_thumb" title="This image" /></div>
</div>
</li>
IE9(8モード)の開発ツールを使用すると.slice
、jQuery(v.1.7.2)のこのビットを参照して、コードのビットに到達すると文句を言うことがわかりました。
// IE6-8 fail to clone children inside object elements that use
// the proprietary classid attribute value (rather than the type
// attribute) to identify the type of content to display
if ( nodeName === "object" ) {
dest.outerHTML = src.outerHTML;
}
それがtbhの意味を正確に理解していない
エラーがスローされないようにするには、何を変更する必要がありますか。また、その理由は何ですか。