Skip to main content

Bug Tracker

Side navigation

#6194 closed bug (worksforme)

Opened March 01, 2010 04:41PM UTC

Closed December 19, 2010 03:24AM UTC

Last modified January 31, 2011 05:55PM UTC

Script tags not evaluated when loaded in page by Ajax, on WebKit

Reported by: ryan@asleson.net Owned by:
Priority: high Milestone: 1.5
Component: ajax Version: 1.5
Keywords: script injection Cc: SlexAxton
Blocked by: Blocking:
Description

I have content that is loaded via Ajax. The loaded content contains a <script> tag. Using jQuery 1.4.1, on Firefox and Safari 4.0.4 (both on Mac), when the content is loaded via Ajax, the code in the <script> tag is executed, as expected.

When using jQuery 1.4.2, the code in the <script> tag is executed when using Firefox, but not when using Safari (and apparently not when using WebKit-based browsers like Android 2's browser or webOS's browser.

This is clearly a regression.

Attachments (1)
  • ticket-6194.zip (129.6 KB) - added by ryan@asleson.net March 01, 2010 04:43PM UTC.

    Test case showing bug

Change History (9)

Changed March 01, 2010 04:47PM UTC by ryan@asleson.net comment:1

Steps to reproduce:

1. Download and unzip the bug-6194.zip file attached to this bug.

2. Open index.html using a WebKit based browser like Safari.

3. click the "load via ajax" link. When you do, there should be an alert box that says "hello world" before the new content is loaded.

4. Open the index.html page in a text editor. Comment out line #57 (the one that loads jQuery 1.4.1) and uncomment line 58 (the one that loads jQuery 1.4.2).

5. Refresh the WebKit browser that's displaying index.html. Again, click on the "load via ajax" link. The new content will load, but the alert box will NOT be displayed (which is incorrect).

6. Note that either version of jQuery works when using Firefox.

Changed June 15, 2010 12:11AM UTC by dmethvin comment:2

component: unfiledajax
description: \ I have content that is loaded via Ajax. The loaded content contains a <script> tag. Using jQuery 1.4.1, on Firefox and Safari 4.0.4 (both on Mac), when the content is loaded via Ajax, the code in the <script> tag is executed, as expected. \ \ When using jQuery 1.4.2, the code in the <script> tag is executed when using Firefox, but not when using Safari (and apparently not when using WebKit-based browsers like Android 2's browser or webOS's browser. \ \ This is clearly a regression. \ I have content that is loaded via Ajax. The loaded content contains a <script> tag. Using jQuery 1.4.1, on Firefox and Safari 4.0.4 (both on Mac), when the content is loaded via Ajax, the code in the <script> tag is executed, as expected. \ \ When using jQuery 1.4.2, the code in the <script> tag is executed when using Firefox, but not when using Safari (and apparently not when using WebKit-based browsers like Android 2's browser or webOS's browser. \ \ This is clearly a regression. \

Changed October 26, 2010 04:12PM UTC by Devon Weller <dweller@devonweller.com> comment:3

This also happens in jQuery 1.4.3 and Safari 5.0.2.

Interestingly, this appears to be fixed in Chrome 8.0.552.11 dev (Mac).

Changed October 27, 2010 04:52PM UTC by SlexAxton comment:4

cc: → SlexAxton
keywords: → script injection
milestone: 1.4.21.4.5
priority: → high
status: newopen

Perhaps it's something in the clean function that changed? I think this one is a regression worth looking into. I'll do some research, as well.

Changed December 18, 2010 12:59PM UTC by iliakan comment:5

Seems fixed in 1.4.3

Changed December 19, 2010 03:24AM UTC by jitter comment:6

resolution: → worksforme
status: openclosed

test case works in current Chrome and Safari 5.0.3 (both on Windows) with jQuery 1.4.4.

Btw. I couldn't reproduce this at all, even when using the version this was reported against (1.4.2). So I guess this is/was either a bug in the plugin the original test case uses (jqTouch) or is a platform specific bug (unlikely).

Some mac-user please checkout my test case and also try switching between 1.4.2/1.4.3/1.4.4/jQuery-Git-version and report back if this has been fixed and if you can reproduce this with 1.4.2 at all.

Changed December 19, 2010 03:32AM UTC by rwaldron comment:7

Luck you! I'm at Rose's now on her Mac and your test is passing in both WebKit browsers.

Changed January 31, 2011 05:53PM UTC by john comment:8

version: 1.4.21.5

There wasn't a 1.4.5 release, was actually 1.5.

Changed January 31, 2011 05:55PM UTC by john comment:9

milestone: 1.4.51.5

There was no 1.4.5 release, was actually 1.5.