Side navigation
#2110 closed bug (worksforme)
Opened January 03, 2008 09:20PM UTC
Closed January 14, 2008 06:38PM UTC
jsonp script elements are never removed
Reported by: | malsup | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.2.2 |
Component: | ajax | Version: | 1.2.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Script elements accumulate when using jsonp. I could be missing something, but this block of code in $.ajax doesn't make sense to me:
// Handle Script loading if ( !jsonp && (s.success || s.complete) ) { var done = false; // Attach handlers for all browsers script.onload = script.onreadystatechange = function(){ if ( !done && (!this.readyState || this.readyState == "loaded" || this.readyState == "complete") ) { done = true; success(); complete(); head.removeChild( script ); } }; }
Why is removing the script element conditional on no jsonp and the presence of callbacks?
Attachments (0)
Change History (1)
Changed January 14, 2008 06:38PM UTC by comment:1
component: | core → ajax |
---|---|
resolution: | → worksforme |
status: | new → closed |
The problem is that if we remove the script before it's done processing, then the request won't complete. We have to wait until it's completed. I think you might be referring to another block of code that was causing problems, but this was resolved in 1.2.2.