Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

119
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda