Bug Tracker

Opened 13 years ago

Closed 13 years ago

#7073 closed bug (wontfix)

The .text() function doesn't return contents of a non-script script tag in IE (7, 8)

Reported by: Pointy Owned by:
Priority: undecided Milestone: 1.4.3
Component: manipulation Version: 1.4.2
Keywords: Cc:
Blocked by: Blocking:


Mr. Resig has blogged about (and therefore promoted) the use of script tags with funny, non-Javascript "type" attributes as a way to store things like template bodies. This is a fine idea and I have no complaints. However, the ".text()" function does not return the contents of such script tags on IE, while ".html()" does. The ".text()" function does work in Firefox and Chrome (haven't tried anything else).

Seems to me that ".text()" should work in this case, or at least behave uniformly.

Change History (2)

comment:1 Changed 13 years ago by jitter

I guess this is a wontfix as it is up to the user agent to decide what to do with <script> tags which have a value set for the type attribute the user agent doesn't know how to handle.

IE seems to ignore such <script> tags and just places the content in the innerHTML property but has childNodes.length == 0 thus text() fails to find anything as there are not TextNode element to get the text from in IE

comment:2 Changed 13 years ago by snover

Resolution: wontfix
Status: newclosed

Just use .html, which already works uniformly across all browsers.

Note: See TracTickets for help on using tickets.