padolsey-archive / jquery.fn

A collection of jQuery plugins
http://james.padolsey.com
The Unlicense
1.1k stars 720 forks source link

IE type mismatch #5

Open kaaelhaa opened 13 years ago

kaaelhaa commented 13 years ago

Hey!

Thanks for this great script!

I'm sorting with: $("PROD_CAT_SORT", xml).sortElements(function (a, b) { return parseInt($(a).text(), 10) > parseInt($(b).text(), 10) ? 1 : -1; }, function () { return this.parentNode; });

It works like a charm in all browsers but IE where I get a "Type Mismatch" on this line:

// Since the element itself will change position, we have // to have some way of storing its original position in // the DOM. The easiest way is to have a 'flag' node: nextSibling = parentNode.insertBefore( document.createTextNode(''), sortElement.nextSibling );

Any ideas?