Bug Tracker

Opened 11 years ago

Closed 11 years ago

#4457 closed bug (invalid)

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:
Blocked by: Blocking:

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 (1)

comment:1 Changed 11 years ago by dmethvin

Resolution: invalid
Status: newclosed

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

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

Note: See TracTickets for help on using tickets.