There was a thread on this list in October which indicates (if I read it 
right) that I ought to be able to rearrange some paragraphs as follows:

<script type="text/javascript">

$(function(){

     jQuery.fn.sort = function() {
       return this.pushStack( [].sort.apply( this, arguments ), []);
     };

     $("p.items").sort(function(a,b){
         return a.innerHTML > b.innerHTML ? 1 : -1;

     }).appendTo("#Foo");

});
</script></head>
<body>

<div id='Foo'>
<p class='items'>C</p>
<p class='items'>B</p>
<p class='items'>A</p>
</div>

</body>
</html>

But this error results:
error: second argument to Function.prototype.apply must be an array

Is it me -- or does the sort function need to be adjusted for jQuery 
1.1.1 (and how would a person do that :-) ?

-- 



Bruce
http://www.2MinuteExplainer.com

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to