Skip to content

Instantly share code, notes, and snippets.

@terenceponce
Created July 19, 2012 05:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save terenceponce/3141054 to your computer and use it in GitHub Desktop.
Save terenceponce/3141054 to your computer and use it in GitHub Desktop.
jQuery Sortable issue in IE9
<!--
Error: Object doesn't support property or method 'attr'
-->
<div class='popover' id='playlist_menu'>
<ul class='toplay' style='overflow:auto'>
<li class='playlist_item' data-id='27' data-order='1' id='videos_27'></li>
<li class='playlist_item' data-id='1' data-order='2' id='videos_1'></li>
<li class='playlist_item' data-id='52' data-order='3' id='videos_52'></li>
</ul>
</div>
// Error: Object doesn't support property or method 'attr'
var items = $(".popover ul.toplay").sortable("toArray");
var i, n;
for (i = 0, n = items.length; i < n; i++) {
var item = $(".playlist_item#" + items[i]);
item.attr("data-order", i + 1); // This is where the error comes from
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment