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

92
Visualizações
Add a method to the JQuery Librairy

I struggle (a lot) on something easy.

I want to add this librairy "JQuery Orthodox View Engine" (aka JOVN) to JQuery. See: https://github.com/JocaPC/jquery-view-engine

In short: The Lib adds a new method to JQuery that can pick some JSON and render it in HTML TAGS that have a certain classname. To do so, i have to import jquery (installed with NPM) and this JOVN Librairy (locally, the NPM package doesn't exist)

import jQuery from 'jquery';
import './jovnLib';

But the jovnLib.js is like this:

   (function($) {
  $.fn.view = function (obj, options) {
    if (!(typeof obj == 'object')) {
      ...
    }
    function loadSelect(nSelect, aoValues, name) {
      ...
    }

    function setElementValue(element, value, name) {
      ...
    }

    function bind(data, domNode, name) {
      ...
    } 

    function init(placeholder) {
      ...
    }

    var defaults = {
      ...
    };

    properties = $.extend(defaults, options);

    return this.each(function () {});
  };
})(JQuery);

I understand that this import has side effects and need to find when it will run, the global variable jQuery, and i have the error:

Uncaught ReferenceError: jQuery is not defined (for the last line of JOVN Module)

Do I might await import or use window.load = () ... Thank you.

about 4 years ago · Juan Pablo Isaza
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