Lucho (mucho) en algo fácil.
Quiero agregar esta biblioteca "JQuery Ortodoxo View Engine" (también conocido como JOVN) a JQuery. Ver: https://github.com/JocaPC/jquery-view-engine
En resumen: The Lib agrega un nuevo método a JQuery que puede seleccionar algo de JSON y representarlo en ETIQUETAS HTML que tienen un cierto nombre de clase. Para hacerlo, tengo que importar jquery (instalado con NPM) y esta biblioteca JOVN (localmente, el paquete NPM no existe)
import jQuery from 'jquery'; import './jovnLib';Pero jovnLib.js es así:
(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);Entiendo que esta importación tiene efectos secundarios y necesito encontrar cuándo se ejecutará, la variable global jQuery, y tengo el error:
Uncaught ReferenceError: jQuery is not defined (for the last line of JOVN Module)¿Puedo esperar a importar o usar window.load = () ... Gracias.