Bug Tracker

Modify

Ticket #16 (closed bug: invalid)

Opened 7 years ago

Last modified 14 months ago

Returning script tag in IE fails

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

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

comment:1 Changed 7 years ago by anonymous

  • Version set to 1.0b1
  • Milestone set to 1.0

comment:2 Changed 7 years ago by john

  • Version changed from 1.0b1 to 1.0

comment:3 Changed 7 years ago by john

  • Version 1.0 deleted
  • Milestone 1.0 deleted

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 7 years ago by joern

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

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

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.