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 8548647
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:32:36+00:00 2026-06-11T13:32:36+00:00

My web application is using a number of JQuery plugins such as the Datatables,

  • 0

My web application is using a number of JQuery plugins such as the Datatables, and it’s corresponding Row Reordering and Sorting plugins.

The problem is that we need to add some fixes to account for annoying IE8 inconsistencies.

So, for example, in one of the plugins _mouseDrag() method we need to add some extra logic at the start. Is there a way to override this function without modifying the plugin’s source code?

In an OO language you would typically override a class method, add some logic and then call the super() method to avoid modifying an API’s source code.

Therefore, I am wondering how we can best support this in JavaScript without modifying the library itself.

Thanks

Updated Question

Based on the example below, how do I override my _mouseDrag function which exists as the following in the 3rd party library:

(function( $, undefined ) {

$.widget("ui.sortable", $.ui.mouse, {

_mouseDrag: function (event){

...

}

How do I override this exactly?

  • 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-11T13:32:36+00:00Added an answer on June 11, 2026 at 1:32 pm

    Try this (see Demo: http://jsfiddle.net/2rZN7/):

    (function ($) {
      var oldPluginFunction =  $.fn.pluginFunction;
    
      $.fn.pluginFunction = function () {
        // your code
        return oldPluginFunction.call(this);
      };
    })(jQuery);
    

    From Demo:

    HTML:

    <span id="text1">text1</span>
    <span id="text2">text2</span>
    

    JavaScript:

    // define and use plugin
    
    $.fn.pluginFunction = function (color) {
      return this.each(function () {
        $(this).css('color', color);
      });
    };
    
    $('#text1').pluginFunction('red');
    
    // redefine and use plugin
    
    (function ($) {
      var oldPluginFunction =  $.fn.pluginFunction;
    
      $.fn.pluginFunction = function () {
        $(this).css('font-size', 24)
        return oldPluginFunction.apply(this, arguments);
      };
    })(jQuery);
    
    $('#text2').pluginFunction('red');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am building a web application using ASP.NET MVC that has two very distinct
I'm using Jquery to draw lines between the cells in a web-based spreadsheet application.
I've written an e-commerce web application using Seam 2.2, JPA, and JSF that, of
I'm trying to build a web application that generates a random number within a
I am sending a DTO to a web service using JQuery, but i need
I'm working on a web application that is using SoundManager2. After beating my head
I am testing a web application using Java Remote Method Invocation (RMI). When I
I creating a web application using JSF,Hibernate,Spring. I have added a filter for checking
I publish my web application using msbuild by calling following command: msbuild myweb.csproj /T:Package
I'm creating a web application using spring mvc. I have started to incorporate 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.