Bug Tracker

Opened 6 years ago

Closed 5 years ago

#13058 closed bug (duplicate)

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

Reported by: mail2008@… Owned by: mail2008@…
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 6 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 6 years ago by dmethvin

Owner: set to mail2008@…
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 6 years ago by mail2008@…

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 6 years ago by dmethvin

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

comment:5 Changed 6 years ago by dmethvin

Resolution: patchwelcome
Status: newclosed

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

comment:6 Changed 6 years ago by vricherson@…

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.

http://www.meyerre.com/m/

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 5 years ago by gibson042

Resolution: patchwelcome
Status: closedreopened

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

comment:8 Changed 5 years ago by gibson042

Resolution: duplicate
Status: reopenedclosed

Duplicate of #14142.

Note: See TracTickets for help on using tickets.