Skip to main content

Bug Tracker

Side navigation

#4265 closed bug (invalid)

Opened February 27, 2009 12:58PM UTC

Closed June 18, 2010 01:07AM UTC

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

Attachments (0)
Change History (1)

Changed June 18, 2010 01:07AM UTC by dmethvin comment:1

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.