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: |
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 10 years ago by
Component: | unfiled → attributes |
---|---|
Milestone: | None → 1.9 |
Priority: | undecided → low |
Status: | new → open |
comment:2 Changed 10 years ago by
Owner: | set to Rick Waldron |
---|---|
Status: | open → assigned |
comment:3 Changed 10 years ago by
Resolution: | → wontfix |
---|---|
Status: | assigned → closed |
Use $('script[type="text/x-data"]').html()
to return the contents of non-executable script elements
Note: See
TracTickets for help on using
tickets.
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!