Skip to content

append() clones for all elements but the last one, not first #344

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

append() clones for all elements but the last one, not first #344

wants to merge 1 commit into from

Conversation

Timothee
Copy link
Contributor

This can be tracked to this line in the code:
https://github.com/jquery/jquery/blob/master/src/manipulation.js#L42

And for domManip:
https://github.com/jquery/jquery/blob/master/src/manipulation.js#L233
iNoClone is what decides if the element is cloned or not, and this is set a bit above to length - 1 which means it won't clone for the last one.

Can also be seen in this "pen": http://codepen.io/adrolldev/pen/zmonw

This can be tracked to this line in the code:
https://github.com/jquery/jquery/blob/master/src/manipulation.js#L42

And for `domManip`:
https://github.com/jquery/jquery/blob/master/src/manipulation.js#L233
`iNoClone` is what decides if the element is cloned or not, and this is set a bit above to `length - 1` which means it won't clone for the last one.

Can also be seen in this "pen": http://codepen.io/adrolldev/pen/zmonw
@kswedberg
Copy link
Member

Hi Timothee, sorry for the delay in responding to this pull request. We'd like everyone who contributes to any of jQuery's repos to sign a Contributor License Agreement (CLA). Would you mind doing that at http://contribute.jquery.org/CLA/? Please make sure that the name and email address match those in your git config. Thanks!

@Timothee
Copy link
Contributor Author

Hey Karl, no problem. I just filled out the form right now. It feels kind of silly for changing three words, but I understand why you need that. Plus, I'm set up for hopefully future contributions! :)

Cheers!

@kswedberg kswedberg closed this in e482af6 Jan 27, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants