Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/benjamingr/takebackjs
Dom Scraper - Take control of your DOM.
https://github.com/benjamingr/takebackjs
Last synced: 4 days ago
JSON representation
Dom Scraper - Take control of your DOM.
- Host: GitHub
- URL: https://github.com/benjamingr/takebackjs
- Owner: benjamingr
- License: gpl-2.0
- Created: 2013-08-06T22:08:27.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-08-07T05:17:12.000Z (over 11 years ago)
- Last Synced: 2024-10-19T05:02:09.641Z (19 days ago)
- Size: 121 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
TakebackJS
==========Take control of your DOM.
Serving HTML from the server can be useful for load times. We still want sensible structure for our data, we want
models that back up our presentation.This converts DOM structure to data bindable objects.
For example, the following table:
Name Title
John Doctor
Fi Fi Dog
Major MajorWith the following HTML structure:
NameTitle
JonDoctor
Fi FiDog
MajorMajor
Gets converted to an array of bindable objects
var s = new Scraper();
ver res = s.scrape("content1");
res[0].name("Snow");//Jon is now Snow in the dom
res[0].name();//Jon
res[1].title();//Dog
res.push({name:"Who",title:"Doctor"});//adds to the DOM too
res.splice(0,1);//removes the first element, both from array and DOM
And so on.###Warning, this is WiP and is _highly_ unstable
##TODO:
- Take back lists and not just tables.
- Fix memory leak when deleting elements (in cache)
- Plugins for Knockout and Angular
- Find more collaborators
- Improve readability