Ticket #6138 (closed enhancement: invalid)
Add option to not delete jsonpCallback upon execution
| Reported by: | orensol | Owned by: | orensol |
|---|---|---|---|
| Priority: | undecided | Milestone: | 1.4.2 |
| Component: | ajax | Version: | 1.4.1 |
| Keywords: | jsonp, jsonpcallback, garbage collection, cache | Cc: | |
| Blocking: | Blocked by: |
Description
When using jsonpCallback to set a static callback function, there should be the ability to have the function remain in scope and not garbage collected.
If I call the exact same jsonp request twice, the first jsonpCallback execution deletes itself, and then the second fails on being undefined.
Maybe there's also an option to cache the response of the first request, and on subsequent requests return the cached result instead of making the entire request and callback cycle?
Change History
comment:1 Changed 3 years ago by addyosmani
- Priority set to undecided
- Type changed from bug to enhancement
comment:2 Changed 3 years ago by snover
- Owner set to orensol
- Status changed from new to pending
I am not sure I understand this. Can you provide a test case?
comment:3 follow-up: ↓ 4 Changed 3 years ago by aboushley
So I think I've produced a test case for what I think orensol is getting at. The callback function isn't deleted, but the jsonp works fine the first time and then after that the callback function is called, but an error is thrown "Uncaught Error: NOT_FOUND_ERR: DOM Exception 8" -- jquery-1.4.3.min.js:135 I know the errors on minified js so its not as helpful, but this fiddle shows it happening. http://jsfiddle.net/vKHdg/
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
