Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rjz/jquery-domdatasource
Did you say bootstrap? A little jQuery magic turns the DOM into a rich data source.
https://github.com/rjz/jquery-domdatasource
Last synced: 17 days ago
JSON representation
Did you say bootstrap? A little jQuery magic turns the DOM into a rich data source.
- Host: GitHub
- URL: https://github.com/rjz/jquery-domdatasource
- Owner: rjz
- Created: 2012-05-06T18:29:37.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2012-05-15T18:53:59.000Z (over 12 years ago)
- Last Synced: 2024-10-22T12:07:18.416Z (2 months ago)
- Language: JavaScript
- Homepage:
- Size: 134 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
jQuery.DOMDataSource
====================Just a simple interface for getting data from the DOM into Javascript.
Usage
-----To retrieve semantic data stored in the DOM, pass a hash of accepted attributes to `$.DOMDataSource`:
yellow
dodge
dart
jQuery(document).ready(function ($) {
var attributes = {
color: '',
make: '',
model: ''
};var car = $('.car').DOMDataSource(attributes);
});Collections of data can also be retrieved from lists:
-
blue
amc
hornet
-
orange
chevrolet
corvair
// in script:
var cars = $('ul').DOMDataSource(attributes);
Finally, data may also be sourced from tables. Note that tables will try and convert the column headers into attribute keys.
Color
Make
Model
green
oldsmobile
woodie
silver
dmc
delorean
// in script:
var cars = $('table').DOMDataSource(attributes);
Author
------
RJ Zaworski
License
-------
The jquery.DOMDataSource plugin is released under the WTFPL License. You can read the license [here](http://sam.zoy.org/wtfpl/).