Bug Tracker

Opened 10 years ago

Closed 9 years ago

#13058 closed bug (duplicate)

.text() doubles text for last xml item on (mobile) Safari

Reported by: [email protected] Owned by: [email protected]
Priority: undecided Milestone: None
Component: unfiled Version: 1.8.3
Keywords: Cc:
Blocked by: Blocking:


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 Markus

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.

comment:2 Changed 10 years ago by dmethvin

Owner: set to [email protected]
Status: newpending

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 [email protected]

Status: pendingnew

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:4 Changed 10 years ago by dmethvin

Can anyone else repro this? I don't have iOS6.

comment:5 Changed 10 years ago by dmethvin

Resolution: patchwelcome
Status: newclosed

Anyone who can repro is welcome to provide additional information and a patch.

comment:6 Changed 10 years ago by [email protected]

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 gibson042

Resolution: patchwelcome
Status: closedreopened

As it turns out, this stemmed from numeric values of the "id" attribute.

comment:8 Changed 9 years ago by gibson042

Resolution: duplicate
Status: reopenedclosed

Duplicate of #14142.

Note: See TracTickets for help on using tickets.