Bug Tracker

Ticket #456 (closed bug: wontfix)

Opened 8 years ago

Last modified 7 years ago

Script tags stripped from innerHTML on .load() (IE5.5)

Reported by: sidebog7 Owned by:
Priority: minor Milestone:
Component: ajax Version:
Keywords: script ajax Cc:
Blocking: Blocked by:

Description

When returning a block of html such as the following the Script tag and anything within is removed. This means that contained script is not executed.

<div>Text</div><script type="text/javascript">alert('Working');</script><div>More Text</div>

On investigating the responseText contains the script, a callback such as function(html){alert(html);} displays the script, whereas if you perform an ALERT($('element').html()); the script is absent.

From further checks setting the innerHTML of an element to a piece of HTML doesn't seem to strip out the script so I am unsure what is causing this.

A fix to this is as reported in bug #16 to add a character (or as I have found to add <table style="display:none"></table> in front of the script)

Change History

comment:1 Changed 8 years ago by joern

  • Priority changed from major to minor
  • Version 1.0 deleted

comment:2 Changed 8 years ago by joern

  • Status changed from new to closed
  • Resolution set to wontfix

A simple workaround is to simply avoid using load to get scripts, use $.getScript instead (and ommit the wrapping html).

Note: See TracTickets for help on using tickets.