Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

123
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda