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

  • Home
  • SEARCH
  • 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 1002757
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T07:52:28+00:00 2026-05-16T07:52:28+00:00

I live and breathe jQuery, but I also love finding an excellent plugin that

  • 0

I live and breathe jQuery, but I also love finding an excellent plugin that does the job I want perfectly.

My Rails app is coded in jQuery, but for file uploading, I’ve yet to find anything better than FancyUpload (better IMHO than Uploadify or SWFUpload). Having tried all three libraries, FancyUpload is by far the best to integrate into my app.

However, FancyUpload is based on MooTools, and loading both libraries (let alone working with them) is beginning to be a bit of a headache. First, I only load MooTools on the pages that use the upload functionality; all other pages use jQuery exclusively. Second, I’ve had to manually namespace many of my jQuery functions, which is slightly annoying.

But perhaps the most cumbersome feature of this setup is that I don’t know MooTools. As I’ve been able to do pretty much everything else with jQuery, I never bothered to learn. Now that I’m forcing myself to use this FancyUpload library (which I love and want to keep using), I’m faced with my ineptitude in MooTools.

Specifically, here is my onFileSuccess function for FancyUpload:

onFileSuccess: function(file, response) {
    var json = new Hash(JSON.decode(response, true) || {});

    if (json.get('status') == '1') {

      // success
        file.element.addClass('file-success');
        (function ($, elem, queue_item) {
          $('#images').append($(elem).hide().fadeIn('slow'));
          $(queue_item).fadeOut('slow', function () { $(this).remove(); });
        })(jQuery, json.get('data'), file.element);

    } else {

      // failure
        file.element.addClass('file-failed');

    }
}

As you’ll notice, I have a jQuery function right in the middle of a MooTools function.

My question is this: is this a really bad thing to do? My function works just as I want it to, but I don’t know if I’m snowballing towards some future disaster by doing this.

If this really is a bad idea, can someone give me a pointer as to what the MooTools-equivalent code would be?

I’d appreciate any insight or help.

  • 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-05-16T07:52:29+00:00Added an answer on May 16, 2026 at 7:52 am

    This is generally not an issue, but I would recommend not mixing framework specific code in any functionality unless the framework you are using doesn’t provide the features you need. This way you keep portability and you only have a single requirement instead of requiring 2 specific versions of 2 different libraries.

    your code should be something like this:

    onFileSuccess: function(file, response) {
        var json = new Hash(JSON.decode(response, true) || {});
    
        if (json.get('status') == '1') {
          // success
            file.element.addClass('file-success');
            document.id('images').adopt(document.id(json.get('data')).fade('hide').fade('in'));
            document.id(file.element).set('tween', {
              onComplete: function() { this.element.dispose();}
            }).fade('out');
        } else {
          // failure
            file.element.addClass('file-failed');
        }
    }
    

    edit: just noticed Dimitar made a somewhat similar reply. my solution works quite the same, but correctly avoids using the $ function which is specially needed when mixing frameworks.

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

Sidebar

Related Questions

I'm trying to build a Chrome browser extension, that should enhance the way the

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.