Side navigation
#12943 closed bug (wontfix)
Opened November 22, 2012 02:33PM UTC
Closed December 03, 2012 06:06PM UTC
IE7: .text() returns empty string on <script> elements
Reported by: | anonymous | Owned by: | rwaldron |
---|---|---|---|
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 == ''
Attachments (0)
Change History (3)
Changed November 22, 2012 03:17PM UTC by comment:1
component: | unfiled → attributes |
---|---|
milestone: | None → 1.9 |
priority: | undecided → low |
status: | new → open |
Changed December 03, 2012 05:17PM UTC by comment:2
owner: | → rwaldron |
---|---|
status: | open → assigned |
Changed December 03, 2012 06:06PM UTC by comment:3
resolution: | → wontfix |
---|---|
status: | assigned → closed |
Use $('script[type="text/x-data"]').html()
to return the contents of non-executable script elements
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!