Bug Tracker

Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#7418 closed bug (fixed)

JsonP not removing script tag when call completed

Reported by: [email protected] Owned by: Rick Waldron
Priority: blocker Milestone: 1.5
Component: ajax Version: 1.4.4rc
Keywords: Cc: john, snover
Blocked by: Blocking:

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 (13)

comment:1 Changed 12 years ago by addyosmani

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.

comment:2 Changed 12 years ago by Rick Waldron

Component: unfiledajax
Owner: set to [email protected]
Status: newpending

comment:3 Changed 12 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.

http://tinyurl.com/28n7jsu

comment:4 Changed 12 years ago by Rick Waldron

Status: pendingopen

Confirmed.

comment:5 Changed 12 years ago by Rick Waldron

Keywords: needsreview added
Priority: undecidedblocker

comment:6 Changed 12 years ago by Rick Waldron

Resolution: worksforme
Status: openclosed

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 12 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 12 years ago by Rick Waldron

Resolution: worksforme
Status: closedreopened

Jitter - thank you. That seemed ever so bizarre that the issue just, "went away". Thanks for the heads up.

comment:9 Changed 12 years ago by Rick Waldron

Owner: changed from [email protected] to Rick Waldron
Status: reopenedassigned

comment:10 Changed 12 years ago by Rick Waldron

Cc: john snover added

comment:11 Changed 12 years ago by Rick Waldron

Updated pull with modified unit tests:

https://github.com/jquery/jquery/pull/95

Additional passing test case

http://jsfiddle.net/rwaldron/QTurz/2/

comment:12 Changed 12 years ago by Rick Waldron

Keywords: needsreview removed

comment:13 Changed 12 years ago by Rick Waldron

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.