Bug Tracker

Opened 15 years ago

Closed 13 years ago

#4265 closed bug (invalid)

text() is not working correctly in IE6/7

Reported by: rlejsza Owned by:
Priority: minor Milestone: 1.3.1
Component: data Version: 1.3.1
Keywords: text() text Cc:
Blocked by: Blocking:

Description

When text() function is called for string without html tags in it, in IE6/7 is not returning value. IE8 (with IE7 compatibility mode is ok), FF3, Opera 9 are working ok.

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

To fix string in variable data need to be inside some html tag:

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

Resolution: invalid
Status: newclosed

$() cannot parse HTML. The string passed there is assigned to a div using div.innerHTML so IE is rejecting the invalid HTML.

Note: See TracTickets for help on using tickets.