Ticket #6194 (closed bug: worksforme)
Script tags not evaluated when loaded in page by Ajax, on WebKit
| Reported by: | ryan@… | Owned by: | |
|---|---|---|---|
| Priority: | high | Milestone: | 1.5 |
| Component: | ajax | Version: | 1.5 |
| Keywords: | script injection | Cc: | SlexAxton |
| Blocking: | Blocked by: |
Description (last modified by dmethvin) (diff)
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
Change History
Changed 3 years ago by ryan@…
-
attachment
ticket-6194.zip
added
comment:1 Changed 3 years ago by ryan@…
Steps to reproduce:
- Download and unzip the bug-6194.zip file attached to this bug.
- Open index.html using a WebKit based browser like Safari.
- 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.
- 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).
- 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).
- Note that either version of jQuery works when using Firefox.
comment:2 Changed 3 years ago by dmethvin
- Component changed from unfiled to ajax
- Description modified (diff)
comment:3 Changed 3 years ago by Devon Weller <dweller@…>
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 3 years ago by SlexAxton
- Cc SlexAxton added
- Keywords script injection added
- Priority set to high
- Status changed from new to open
- Milestone changed from 1.4.2 to 1.4.5
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:6 in reply to: ↑ 5 Changed 3 years ago by jitter
- Status changed from open to closed
- Resolution set to worksforme
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 3 years ago by rwaldron
Luck you! I'm at Rose's now on her Mac and your test is passing in both WebKit browsers.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Test case showing bug