Bug Tracker

Modify

Ticket #6138 (closed enhancement: invalid)

Opened 3 years ago

Last modified 14 months ago

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/

comment:4 in reply to: ↑ 3 Changed 3 years ago by jitter

Replying to aboushley:

So I think I've produced a test case for what I think orensol is getting at.

No, what you reproduced is the bug reported in #7418. Which is an exception when trying to remove a script tag in the internal callback handler

comment:5 Changed 2 years ago by trac-o-bot

  • Status changed from pending to closed
  • Resolution set to invalid

Automatically closed due to 14 days of inactivity.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.