Skip to main content

Bug Tracker

Side navigation

#13058 closed bug (duplicate)

Opened December 14, 2012 08:59PM UTC

Closed October 08, 2013 01:12PM UTC

.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:

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.


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,


Attachments (0)
Change History (8)

Changed December 14, 2012 09:05PM UTC by Markus comment:1

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.

Changed December 21, 2012 04:17AM UTC by dmethvin comment:2

owner: →
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?

Changed December 21, 2012 10:12AM UTC by comment:3

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.

Changed January 26, 2013 09:00PM UTC by dmethvin comment:4

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

Changed February 24, 2013 09:39PM UTC by dmethvin comment:5

resolution: → patchwelcome
status: newclosed

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

Changed June 11, 2013 04:24PM UTC by comment:6

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

Changed October 08, 2013 01:11PM UTC by gibson042 comment:7

resolution: patchwelcome
status: closedreopened

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

Changed October 08, 2013 01:12PM UTC by gibson042 comment:8

resolution: → duplicate
status: reopenedclosed

Duplicate of #14142.