Socket
Book a DemoInstallSign in
Socket

jquery-pluginconfig

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jquery-pluginconfig

A jQuery plugin that help use data attributes for configuration

0.0.2
latest
Source
npmnpm
Version published
Weekly downloads
4
-50%
Maintainers
1
Weekly downloads
 
Created
Source

jquery-pluginconfig

Build Status

Installation

You can install with npm

  $ npm install jquery-pluginconfig

With Bower

  bower install jquery-pluginconfig

Or use some of the files at dist folder.

Usage

Let's say you have a jQuery plugin called my-awesome-plugin. And you want to allow the user to set the configs of that plugin for a given element using data-* attributes.

You can let them do this:

  <div class="my-element" data-my-awesome-plugin-config="hello" data-my-awesome-plugin-config-two="world"></div>div>

And then you can do this:

  var config = $('.my-element').pluginConfig('my-awesome-plugin');

  // You'll get { config: "hello", configTwo: "world"}

  // Then use it

  $('.my-element').myAwesomePlugin(config);

You can also use it internally of your plugin, so the user won't have to call pluginConfig every time.

That's all, folks!

Keywords

jquery

FAQs

Package last updated on 13 May 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.