Skip to main content

Bug Tracker

Side navigation

#1332 closed bug (fixed)

Opened June 28, 2007 06:46PM UTC

Closed July 20, 2007 10:01PM UTC

script evaluation not working properly in ie6

Reported by: db Owned by: john
Priority: major Milestone: 1.1.4
Component: ajax Version: 1.1.3
Keywords: Cc:
Blocked by: Blocking:
Description

While using this function:

$.ajax({

type: "POST",

url: page,

data: args,

dataType: "html",

... etc.

I found that ie6 does not evaluate any scripting included in the returned data.

like:

--snip--

<script type="text/javascript">alert('loading!');</script><h1>some other html</h1>

--snip--

fails completely in ie6 (6.0.2900.2180). This script evaluation does happen with other browsers; just not ie6.

-Thanks

-Dan Bryant

Attachments (0)
Change History (4)

Changed July 05, 2007 01:34PM UTC by pedromello comment:1

same occurs on IE7

Changed July 13, 2007 07:35PM UTC by pedromello comment:2

Replying to [comment:1 pedromello]:

same occurs on IE7

Apparently IE6/7 can't correctly evaluate the regexp in find method to locate the script tags.

So I've coded a temporary workaround, to be called after DOM is updated.

function extractScripts(data)

{

if ($.browser.msie) {

var re = new RegExp('<script[^>]*>([\\\\S\\\\s]*?)<\\/script>','im');

var rs = data.match(/<script[^>]*>([\\S\\s]*?)<\\/script>/img);

var parse = $.map(rs, function(tag) {

return re.exec(tag).pop();

});

$(parse).each(function(k,v) {

jQuery.globalEval(v);

});

}

}

Changed July 20, 2007 03:30PM UTC by john comment:3

milestone: 1.1.31.1.4
need: ReviewTest Case
owner: → john
version: 1.1.21.1.3

Changed July 20, 2007 10:01PM UTC by john comment:4

resolution: → fixed
status: newclosed

Fixed in SVN rev [2428].