Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7955011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T03:36:16+00:00 2026-06-04T03:36:16+00:00

I’m using: https://github.com/blueimp/jQuery-File-Upload Basically, I need to be able to save the current done

  • 0

I’m using: https://github.com/blueimp/jQuery-File-Upload

Basically, I need to be able to save the current done callback and call it in my own done callback which is unbelievably complicated (I’m not familiar with jquery ui widgets).

Here’s the code I’m trying to get to work to no avail:

var $el = $('#fileupload');
$el.fileupload();
var olddone = $el.fileupload('option', 'done');
$el.fileupload('option', 'done', function(e, data) {
    data = ... manipulate data ...;
    return olddone(e, data);
});

I’ve tried various variations on the theme:

return olddone.call(this, e, data);

and:

return olddone.call($el.data('fileupload'), e, data);

and:

return olddone.call($el[0], e, data);

And all errors basically tell me that this is not correct and the context is not right for all the following calls. What am I doing wrong? How can I more or less subclass a specific callback but still use/call the original callback?

What’s worse, is that copying the source of the done callback in place of olddone (instead of saving a reference and calling it) doesn’t seem to work either.

What is this in the context of a jQuery UI Widget options function? Why is this so convoluted? What am I missing?

EDIT:
After reading some widget documentation, it seems that all the methods are always called with the widget instance as this, so why wouldn’t the following work right?

olddone.call($el.data('fileupload'), e, data)

UPDATE:

I’m trying to preserve the done: callback in options that are here: https://github.com/blueimp/jQuery-File-Upload/blob/75d11179fd9c248c061c8eb428782bb556c8db0a/js/jquery.fileupload-ui.js#L139

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T03:36:17+00:00Added an answer on June 4, 2026 at 3:36 am

    Figured out that I was misusing the data passed in and I really just needed to use it correctly. This is the final code I needed to get this working.

    var olddone = $el.data('fileupload').options.done;
    $el.fileupload('option', 'done', function(e, data) {
        data.result = ... manipulate data ...;
        return olddone.call(this, e, data);
    });
    

    The olddone.call(this, ...) turned out to still be necessary for some reason. Not sure why this was inherited from the current context and was instead undefined.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
I am reading a book about Javascript and jQuery and using one of the
In my XML file chapters tag has more chapter tag.i need to display chapters
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I am using Paperclip to handle profile photo uploads in my app. They upload
I have thousands of HTML files to process using Groovy/Java and I need to
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a jquery bug and I've been looking for hours now, I can't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.