0.41.3 • Published 1 year ago

@util.js/jquery v0.41.3

Weekly downloads
1
License
MIT
Repository
github
Last release
1 year ago

@util.js/jquery

JavaScript utility methods for jQuery

@util.js/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("@util.js/jquery");
jQueryUtils
  .loadjQuery({ window })
  .then(($) => console.log($))
  .catch(console.log);

Example

const jQueryUtils = require("@util.js/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("@util.js/jquery");
jQueryUtils.loadjQuery({ window }, (error, $) => {
  if (error) return console.log(error);
  console.log($);
});
0.41.3

1 year ago

0.41.2

1 year ago

0.41.1

3 years ago

0.41.0

3 years ago

0.40.1

3 years ago

0.40.0

3 years ago

0.39.2

5 years ago

0.39.1

5 years ago

0.39.0

5 years ago

0.38.0

5 years ago

0.37.1

5 years ago

0.37.0

5 years ago

0.36.1

5 years ago

0.36.0

5 years ago

0.35.0

5 years ago

0.34.0

5 years ago

0.33.1

5 years ago

0.33.0

5 years ago

0.32.0

5 years ago

0.31.0

5 years ago

0.30.0

5 years ago

0.29.1

5 years ago