Ticket #7418 (closed bug: fixed)
JsonP not removing script tag when call completed
| Reported by: | jeremyk@… | Owned by: | rwaldron |
|---|---|---|---|
| Priority: | blocker | Milestone: | 1.5 |
| Component: | ajax | Version: | 1.4.4rc |
| Keywords: | Cc: | john, snover | |
| Blocking: | Blocked by: |
Description
Seem to be still experiencing the bug for Ticket #7196, in jQuery 1.4.4 RC2. For a detailed explanation of the problem please see this http://stackoverflow.com/questions/4107360/jquery-ajax-1-4-3-jsonp-call-not-removing-callback-script-from-head-tag
Change History
comment:2 Changed 3 years ago by rwaldron
- Owner set to jeremyk@…
- Status changed from new to pending
- Component changed from unfiled to ajax
comment:3 Changed 3 years ago by anonymous
Here is a sample. Clicking the first link in this page will fetch an ID from the service and the <script> tag in the head will be removed. However clicking any of the other two links will get the correct ID but cause an error and the <script> tag is never removed.
comment:5 Changed 3 years ago by rwaldron
- Keywords needsreview added
- Priority changed from undecided to blocker
comment:6 follow-up: ↓ 7 Changed 3 years ago by rwaldron
- Status changed from open to closed
- Resolution set to worksforme
I've re-assessed this issue and I'm confident the issue is in fact non-existent.
Reduced case: http://jsfiddle.net/rwaldron/asCrS/5/
Recreation of original case: http://jsfiddle.net/rwaldron/CYvsv/
comment:7 in reply to: ↑ 6 Changed 3 years ago by jitter
Replying to rwaldron:
I've re-assessed this issue and I'm confident the issue is in fact non-existent.
Please reopen the ticket. Due to a simple oversight both of your test cases are missing an important piece which prevent the exceptions experienced in the original test case. The callback functions you use (handleJsonp / fetchLocationCallback) aren't globally defined in neither test case.
But that is crucial to reproduce the original issue.
http://jsfiddle.net/asCrS/11/ your reduced test case this time with callback function globally defined (2nd click triggers exception)
http://www.jsfiddle.net/jitter/8dLfY/ more verbose test case which uses "no wrap (head)" to make sure the function is globally available and not hidden in the jquery-ready-handler-scope. Here you can check conveniently check that <script> tags really aren't removed from <head>
comment:8 Changed 3 years ago by rwaldron
- Status changed from closed to reopened
- Resolution worksforme deleted
Jitter - thank you. That seemed ever so bizarre that the issue just, "went away". Thanks for the heads up.
comment:9 Changed 3 years ago by rwaldron
- Owner changed from jeremyk@… to rwaldron
- Status changed from reopened to assigned
comment:10 Changed 3 years ago by rwaldron
- Cc john, snover added
comment:11 Changed 3 years ago by rwaldron
Updated pull with modified unit tests:
https://github.com/jquery/jquery/pull/95
Additional passing test case
comment:13 Changed 2 years ago by rwaldron
- Status changed from assigned to closed
- Resolution set to fixed
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Please provide us a reduced test case that ideally connects to the same server that you are performing testing with in your StackOverflow response. Without a complete test case we are unable to accurately reproduce what you are trying to do.