Side navigation
#8395 closed bug (invalid)
Opened February 26, 2011 08:37PM UTC
Closed February 28, 2011 11:20AM UTC
Last modified March 01, 2011 03:11AM UTC
.append does not insert strings with html markup, does not always insert strings - jQuery 1.5
Reported by: | donovan@donovanwalker.com | Owned by: | donovan@donovanwalker.com |
---|---|---|---|
Priority: | low | Milestone: | 1.next |
Component: | manipulation | Version: | 1.5.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Running FF 3.6.13
With an empty body tag, or a body tag with a single unattributed, unstyled div..
$('body').append('somestring'); works
$('div').append('somestring'); works
$('body').append('<div>asdf</div>'); fails with
Node cannot be inserted at the specified point in the hierarchy - code: 3
$('div').append('<div>asdf</div>');
Node cannot be inserted at the specified point in the hierarchy - code: 3
Additionally:
- In tests where the insertion string includes HTML markup that is preceded by non HTML insertion has been found to work -on occasion-
- There are other instances of insertion failure for non-HTML strings in situations that may involve nested matching elements
Attachments (0)
Change History (9)
Changed February 26, 2011 08:38PM UTC by comment:1
Changed February 27, 2011 01:54AM UTC by comment:2
owner: | → donovan@donovanwalker.com |
---|---|
status: | new → pending |
No problem, just log in and add your jsfiddle case so the ticket won't be closed.
Changed February 27, 2011 02:52AM UTC by comment:3
status: | pending → new |
---|
I'm unable to replicate the error with jsFiddle, but it does exist in 'standalone' documents.
Advice?
Changed February 27, 2011 02:59AM UTC by comment:4
component: | unfiled → manipulation |
---|---|
priority: | undecided → low |
status: | new → pending |
I'm having a hard time believing that this is a jQuery bug, considering the high volume of our >4000 unit tests actually do this very operation as part of testing another piece of functionality. If this were the case, the test suite would be failing an unacceptable number of tests (1 fail is considered unacceptable).
Any simple manipulation test should be reproducible in jsFiddle
Changed February 27, 2011 09:36PM UTC by comment:5
I share rwaldron's thoughts on this.
That said, an alternative to you posting the code on jsFiddle is uploading us a zip or HTML file containing the local 'standalone' document tests you've been running. This will allow us to evaluate for certain whether the issue is with jQuery or some aspect of your code. Thanks!
Changed February 27, 2011 11:46PM UTC by comment:6
status: | pending → new |
---|
Yup. I'm going to do some more work to get an absolute minimum amount of code that reproduces the error and attempt to replicate that in fiddle. I'll submit my results with a link to fiddle, or the code, or a request to close the ticket.
Stay tuned!
Changed February 28, 2011 05:06AM UTC by comment:7
Ok, it turns out the minimum amount of code to reproduce the error is jQuery 1.5.1 + a really cool templating plugin I've been maintaining for a couple years. (Orange-J)
I don't even need to run the plugin's code.. just including it breaks something. Can you take a peek and tell me what's broke with this version of jQuery?
I've included a fiddle with embedded source code.
http://jsfiddle.net/relativityboy/uGzvK/1/
Close the ticket, but please give me a hand if you can figuring this one out. TIA!
Changed February 28, 2011 11:20AM UTC by comment:8
resolution: | → invalid |
---|---|
status: | new → closed |
Replying to [comment:7 anonymous]:
Ok, it turns out the minimum amount of code to reproduce the error is jQuery 1.5.1 + a really cool templating plugin I've been maintaining for a couple years. (Orange-J) I don't even need to run the plugin's code.. just including it breaks something. Can you take a peek and tell me what's broke with this version of jQuery? I've included a fiddle with embedded source code. http://jsfiddle.net/relativityboy/uGzvK/1/ Close the ticket, but please give me a hand if you can figuring this one out. TIA!
Without checking too closely the problem seems to be that your plugin defines it's own jQuery.clone
method and thus overwrites the original one which exists since jQuery 1.5
Changed March 01, 2011 03:11AM UTC by comment:9
Ha! You're right! jQuery co-opted my clone method name.
For a long time I've been thinking about scoping orange-j within a child attribute. Are there any single letter attributes that are safe?
$.o.<methodname> or $.j. or $.oj._ some such? I'd really hate to have to retro actively fix something like $('x').snippet()..
Better yet, any thoughts on getting the templating part incorporated into UI?
Sorry about not using jsFiddle...