Bug Tracker

Opened 16 years ago

Closed 16 years ago

Last modified 10 years ago

#16 closed bug (invalid)

Returning script tag in IE fails

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

Description

IE will not execute javascript with surrounding script tags unless the tags are preceded by a character. Thus returning the following in response to a .load fails to execute in IE: <script type="text/javascript"> /* <![CDATA[ */

alert("here");

/* ]]> */ </script>

Preceding with some character works: - <script type="text/javascript"> /* <![CDATA[ */

alert("here");

/* ]]> */ </script>

Change History (4)

comment:1 Changed 16 years ago by anonymous

Milestone: 1.0
Version: 1.0b1

comment:2 Changed 16 years ago by john

Version: 1.0b11.0

comment:3 Changed 16 years ago by john

Milestone: 1.0
Version: 1.0

I don't plan on getting to this for 1.0. The obvious workaround, however, is to simply return just the Javascript, then eval that on the fly - as opposed to injecting it into the DOM (which I assume that you're doing).

comment:4 Changed 16 years ago by joern

Resolution: invalid
Status: newclosed

Can be easily worked around by ommiting the script tags in the response (and using $.getScript() to eval on the fly).

Note: See TracTickets for help on using tickets.