Bug Tracker

Opened 13 years ago

Closed 12 years ago

Last modified 12 years ago

#6194 closed bug (worksforme)

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

Reported by: [email protected] Owned by:
Priority: high Milestone: 1.5
Component: ajax Version: 1.5
Keywords: script injection Cc: SlexAxton
Blocked by: Blocking:

Description (last modified by dmethvin)

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 [email protected] 13 years ago.
Test case showing bug

Download all attachments as: .zip

Change History (10)

Changed 13 years ago by [email protected]

Attachment: ticket-6194.zip added

Test case showing bug

comment:1 Changed 13 years ago by [email protected]

Steps to reproduce:

  1. Download and unzip the bug-6194.zip file attached to this bug.
  1. Open index.html using a WebKit based browser like Safari.
  1. 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.
  1. 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).
  1. 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).
  1. Note that either version of jQuery works when using Firefox.

comment:2 Changed 13 years ago by dmethvin

Component: unfiledajax
Description: modified (diff)

comment:3 Changed 12 years ago by Devon Weller <[email protected]…>

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).

comment:4 Changed 12 years ago by SlexAxton

Cc: SlexAxton added
Keywords: script injection added
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.

comment:5 Changed 12 years ago by iliakan

Seems fixed in 1.4.3

comment:6 in reply to:  5 Changed 12 years ago by jitter

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.

comment:7 Changed 12 years ago by Rick Waldron

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

comment:8 Changed 12 years ago by john


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

comment:9 Changed 12 years ago by john


There was no 1.4.5 release, was actually 1.5.

Note: See TracTickets for help on using tickets.