My guess is that it has to do with jQuery sanitizing HTML that you pass it;
it does a fair amount of that.  As to a work around, one possibility would
be to build the string, and then pass it as well-formed HTML to jQuery's
after().  String operations are probably not the quickest, though.

--Kit

On Thu, Aug 21, 2008 at 12:10 PM, webrocker <[EMAIL PROTECTED]> wrote:

>
> Hi,
>
> I have a rather long unordered list with about hundred items inside.
> each is wrapped in <li>...</li>
> I want to split this list into several small lists, with, say, 10
> items each.
> to do that I have this code:
>
>        checkvar = 1;
>        $('#right ul li').each(function(){
>                if( checkvar%10 == 0){
>                        $(this).after('</ul><ul>');
>                }
>                checkvar++;
>        });
>
> basically this works, but somehow jQuery fixes the order of the
> inserted '</ul><ul>' to '<ul></ul>'.
> interestingly, if I try to put 'zzz aaa', I get 'zzz aaa' as expected.
> The moment tag-brackets are used (even with '<zzz> <aaa>' I will get
> '<aaa> <zzz>' in the result.
>
> Any suggestions whats happening here?
> thanks
> Tom
>

Reply via email to