Opened 10 years ago
Closed 9 years ago
#13058 closed bug (duplicate)
.text() doubles text for last xml item on (mobile) Safari
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 1.8.3 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Dear jQuery-Team, I think I found a bug:
- I load XML data to jQuery, part of it contains CDATA.
- I output a CDATA node.
- When iterating through the elements, everything is fine, except for the last element in the XML list: Here, all CDATA text (only this!) is doubled.
See: http://jsfiddle.net/pHAUb/3/
This happens only in Mobile Safari (iPhone 4, iOS 6). I don't have an iPad or a Mac to test if it happens on other Apple products as well. It does NOT happen in Firefox, Chrome or IE9.
Best regards, Markus
Change History (8)
comment:1 Changed 10 years ago by
comment:2 Changed 10 years ago by
Owner: | set to [email protected]… |
---|---|
Status: | new → pending |
This sounds like it may be a Mobile Safari bug if it only happens on one browser. Can you create a test case that shows it working properly without jQuery?
comment:3 Changed 10 years ago by
Status: | pending → new |
---|
Sorry, I wouldn't know how to do this. All I can say is that even WITH jQuery it can work properly if I use another selector: .eq(index) instead of .find('item[id="xxx"]'). It only fails using the .find('item[id="xxx"]') selector.
comment:5 Changed 10 years ago by
Resolution: | → patchwelcome |
---|---|
Status: | new → closed |
Anyone who can repro is welcome to provide additional information and a patch.
comment:6 Changed 10 years ago by
We have the same or a similar problem on our mobile site when using .text on an element. We are replacing a phone number when the page loads.
Works fine on desktop but mobile safari is doubling the phone number in the header and footer. It's also a problem on our area page http://www.meyerre.com/area/
comment:7 Changed 9 years ago by
Resolution: | patchwelcome |
---|---|
Status: | closed → reopened |
As it turns out, this stemmed from numeric values of the "id" attribute.
comment:8 Changed 9 years ago by
Resolution: | → duplicate |
---|---|
Status: | reopened → closed |
Duplicate of #14142.
I forgot one thing: It must have something to do with the selector 'item[id="xxx"]'. When I access the CDATA node using the .eq(index) selector, the error does not appear.