Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

121
Views
Need Alternate Approach Instead of `arguments.callee` in jQuery Plugin

With `arguments.callee deprecated I would like to find al alternative approach to extend a jQuery plugin I created to execute one of its built in methods from the outside.

My sample jQuery plugin:

(function($) {
$.myPlugin = function(options) {
  // normal var and methods

  // this is to execute a method from outside
  arguments.callee.close = function() {
    // to do when this is called
  }
}
}(jQuery))

The plugin would be used for it’s normal use with this

$(selector).myPlugin();

And this is to trigger the “close” method inside the plugin

$(selector).myPlugin.close()
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I found an answer to this and have this to share:

(function($) {
  function myPlugin(options) {
    // normal var and methods: do whatever I want...

    myPlugin.close = myPlugin.close.bind(this);
  }

  myPlugin.close = function() {
    // do this thing
  }

  $.fn.myPlugin = myPlugin;

}(jQuery));

This allows me to call the close method with this:

$(selector).myPlugin.close();
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!