Skip to main content

Bug Tracker

Side navigation

#7073 closed bug (wontfix)

Opened September 23, 2010 11:14PM UTC

Closed October 03, 2010 02:15AM UTC

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:
Description

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.

Attachments (0)
Change History (2)

Changed October 01, 2010 02:28PM UTC by jitter comment:1

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

Changed October 03, 2010 02:15AM UTC by snover comment:2

resolution: → wontfix
status: newclosed

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