Bug Tracker

Opened 10 years ago

Closed 10 years ago

#12943 closed bug (wontfix)

IE7: .text() returns empty string on <script> elements

Reported by: anonymous Owned by: Rick Waldron
Priority: low Milestone: 1.9
Component: attributes Version: 1.8.2
Keywords: Cc:
Blocked by: Blocking:


jsFiddle: http://jsfiddle.net/KTjfK/

<script type="text/x-data">
some text
<script type="text/javascript">
var txt = $('script[type="text/x-data"]').text();

Expected: txt == 'some text'

Actual in IE7: text ==

Change History (3)

comment:1 Changed 10 years ago by dmethvin

Component: unfiledattributes
Milestone: None1.9
Priority: undecidedlow
Status: newopen

Related to #9832. Not sure if we'll land anything for this. For example, I can't see adding a .text() setter for script tags and expecting that to execute!

comment:2 Changed 10 years ago by Rick Waldron

Owner: set to Rick Waldron
Status: openassigned

comment:3 Changed 10 years ago by Rick Waldron

Resolution: wontfix
Status: assignedclosed

Use $('script[type="text/x-data"]').html() to return the contents of non-executable script elements

Note: See TracTickets for help on using tickets.