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

120
Views
Necesita un enfoque alternativo en lugar de `arguments.callee` en el complemento jQuery

Con `arguments.callee en desuso, me gustaría encontrar un enfoque alternativo para extender un complemento de jQuery que creé para ejecutar uno de sus métodos integrados desde el exterior.

Mi complemento jQuery de muestra:

 (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))

El complemento se usaría para su uso normal con este

 $(selector).myPlugin();

Y esto es para activar el método de "cerrar" dentro del complemento.

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

0

Encontré una respuesta a esto y tengo esto para compartir:

 (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));

Esto me permite llamar al método close con esto:

 $(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!