Bug Tracker

Modify

Ticket #4457 (closed bug: invalid)

Opened 4 years ago

Last modified 4 years ago

text() with XML parsing is not working correctly in IE6/7

Reported by: rlejsza Owned by:
Priority: major Milestone: 1.4
Component: core Version: 1.3.2
Keywords: text text() xml ie6 ie7 Cc:
Blocking: Blocked by:

Description

When text() function is called for string without html(xml) tags in it, in IE6/7 is returning wrong value.

Not affected: IE8 (also with IE7 compatibility mode), FF3, Opera 9.

How to reproduce:

var data = "<?xml version=\"1.0\" encoding=\"utf-8\"?><string xmlns=\" http://192.168.2.3:81/WebService.asmx\">TEXT</string> ";

var ret = $(data).text();

alert(ret);

How to correct:

var data = "<?xml version=\"1.0\" encoding=\"utf-8\"?><string xmlns=\" http://192.168.2.3:81/WebService.asmx\"><a>TEXT</a></string> ";

var ret = $(data).text();

alert(ret);

Change History

comment:1 Changed 4 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to invalid

You cannot pass xml to the $(html) constructor. See the documentation:

 http://docs.jquery.com/Core/jQuery#htmlownerDocument

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.