0.29.0 • Published 5 years ago

utiljs-jquery v0.29.0

Weekly downloads
4
License
MIT
Repository
github
Last release
5 years ago

utiljs-jquery

JavaScript utility methods for jQuery

utiljs-jquery is part of Util.js.

JQueryUtils API

Kind: global class
Access: public

jQueryUtils.loadjQuery(params, callback) ⇒ undefined | Promise

Loads jQuery asynchronously and sends a notification when loading has finished

Kind: instance method of JQueryUtils
Returns: undefined | Promise - undefined if a callback is specified or a Promise that returns jQuery once jQuery has finished loading
Throws:

  • Error If params is undefined, null, or params has an invalid window object

Access: public

ParamTypeDefaultDescription
paramsObject
params.srcstring"https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"The jQuery script to load
params.windowWindowThe browser's window
callbackfunctionA callback function that takes two arguments: error and jQuery

Example

const jQueryUtils = require("utiljs-jquery");
jQueryUtils
  .loadjQuery({ window })
  .then($ => console.log($))
  .catch(console.log);

Example

const jQueryUtils = require("utiljs-jquery");
jQueryUtils
  .loadjQuery({
    src: "https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js",
    window
  })
  .then($ => console.log($))
  .catch(console.log);

Example

const jQueryUtils = require("utiljs-jquery");
jQueryUtils.loadjQuery({ window }, (error, $) => {
  if (error) return console.log(error);
  console.log($);
});
0.29.0

5 years ago

0.28.1

5 years ago

0.24.0

6 years ago

0.23.1

6 years ago

0.23.0

6 years ago

0.22.0

6 years ago

0.21.0

6 years ago