Uploaded image for project: 'PUBLIC - Liferay Alloy UI'
  1. PUBLIC - Liferay Alloy UI
  2. AUI-894

<script> getting stripped in IE when using innerHTML and text content is empty

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.0.3, 2.0.x, 1.5.3, 1.7.x
    • Fix Version/s: 1.5.3
    • Component/s: Parse Content
    • Labels:
      None
    • Environment:
      Browsers: IE8, IE7, IE6

      Description

      I have a string of HTML; I'm getting from an AJAX request

      <span></span><script>alert("test")</script>

      In IE 8, 7, 6, when using node.plug(A.Plugin.ParseContent);, IE strips any <script> when there isn't any text content (text nodes?).

      But if I add any text, the <script> doesn't get stripped.

      <span>text</span><script>alert("test")</script>

      Comments by John Sudds (Microsoft) on this MSDN article, explains the behavior:
      http://msdn.microsoft.com/en-us/library/ms533897(v=vs.85).aspx

      Another explanation of the behavior:
      http://allofe.com/contentm/easy_pages/easy_page_view.php?sid=62&page_id=246&blueprint_id=22

      Article focusing on NoScope element, with a solution using a soft hyphen entity (&shy;)
      http://www.thecssninja.com/javascript/noscope

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              nathan.cavanaugh Nate Cavanaugh
              Reporter:
              byran.zaugg Byran Zaugg (Inactive)
              Participants of an Issue:
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                8 years, 19 weeks, 4 days ago

                  Packages

                  Version Package
                  1.5.3