Re: [jQuery] bug found

2007-03-29 Thread Klaus Hartl
Michel Brouckaert schrieb:
> ok, that is actually an very true thought but still it's an quiet
> strict and weird interpretation of the words insertAfter..
> This actualy means at the end that it is rather impossible to add an
> item after an root element without appending it..

There shouldn't be an element after the root element anyway. In XML that 
wouldn't be well-formed and in HTML the  element has no sibling 
either.



-- Klaus

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] bug found

2007-03-29 Thread Michel Brouckaert
ok, that is actually an very true thought but still it's an quiet
strict and weird interpretation of the words insertAfter..
This actualy means at the end that it is rather impossible to add an
item after an root element without appending it..

2007/3/29, Karl Swedberg <[EMAIL PROTECTED]>:
> this might not actually be a bug. I have a hunch that it has to do with your
> use of .insertAfter()
>
> .insertAfter() will insert the elements one at a time in the correct order,
> but since each one is being inserted immediately after the h2, each is
> appearing before the previous one.
>
> I'm probably not explaining this well, so I'll just say that you will have
> more success using .appendTo(). Depending on how your DOM is structured, you
> might want to first create a container div after the h2 and then append your
> $(html) to that.
>
>
> --Karl
> _
> Karl Swedberg
> www.englishrules.com
> www.learningjquery.com
>
>
>
>
> On Mar 29, 2007, at 9:17 AM, Michel Brouckaert wrote:
>
> this is a bug I found when using firebug to refresh some data in an menu..
> code:
> $.post(rAction,{action:"login",ddd:$("#ccc").val(),ddd:$("#ddd").val()},function(html){
>  $(html).insertAfter($("div#compte .padder fieldset
> h2")).load(errorVerif2());
>  activeMenu();
>  $.load(errorVerif2());
>  });
> instead of returning
> 1
> 2
> 3
> 
>  1
>  2
>  3
> 
>
> it returned the following
>
>
> 
>  1
>  2
>  3
> 
> 3
> 2
> 1
>
> the reversion of the elements only seems to happen on the top level
> elements of the html answer.
> But it seems rather disturbing.
>
> thx for reading this.
> Michel Brouckaert
>
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
>
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
>
>

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] bug found

2007-03-29 Thread Karl Swedberg
this might not actually be a bug. I have a hunch that it has to do  
with your use of .insertAfter()


.insertAfter() will insert the elements one at a time in the correct  
order, but since each one is being inserted immediately after the h2,  
each is appearing before the previous one.


I'm probably not explaining this well, so I'll just say that you will  
have more success using .appendTo(). Depending on how your DOM is  
structured, you might want to first create a container div after the  
h2 and then append your $(html) to that.



--Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com



On Mar 29, 2007, at 9:17 AM, Michel Brouckaert wrote:

this is a bug I found when using firebug to refresh some data in an  
menu..

code:
			$.post(rAction,{action:"login",ddd:$("#ccc").val(),ddd:$ 
("#ddd").val()},function(html){

$(html).insertAfter($("div#compte .padder 
fieldset
h2")).load(errorVerif2());
activeMenu();
$.load(errorVerif2());
});
instead of returning
1
2
3

 1
 2
 3


it returned the following



 1
 2
 3

3
2
1

the reversion of the elements only seems to happen on the top level
elements of the html answer.
But it seems rather disturbing.

thx for reading this.
Michel Brouckaert

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/