Bug Tracker

Modify

Ticket #7073 (closed bug: wontfix)

Opened 3 years ago

Last modified 3 years ago

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

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.

Change History

comment:1 Changed 3 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 3 years ago by snover

  • Status changed from new to closed
  • Resolution set to wontfix

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

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.