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

96
Views
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
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!