Bug Tracker

Opened 7 years ago

Closed 6 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:

Description

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

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

Expected: txt == 'some text'

Actual in IE7: text ==

Change History (3)

comment:1 Changed 7 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 6 years ago by Rick Waldron

Owner: set to Rick Waldron
Status: openassigned

comment:3 Changed 6 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.