Get All Elements By Class Using Javascript
Posted by admin on
March 19, 2013
There is no functionality in Javascript where you can get all elements by class name. Yes, in JQuery you can but that involves loading up a library.
If you do not have any other need for JQuery, this class made by some user in the Stack Overflow forum does the trick.
function getAllByClass(classname, node) { if (!document.getElementsByClassName) { if (!node) { node = document.body; } var a = [], re = new RegExp('\\b' + classname + '\\b'), els = node.getElementsByTagName("*"); for (var i = 0, j = els.length; i < j; i++) { if (re.test(els[i].className)) { a.push(els[i]); } } } else { return document.getElementsByClassName(classname); } return a; }
tags: all elements, by class, class, elements, function, get, javascript
No Comments
Extract SQLite Database From Android Emulator
Posted by admin on
May 15, 2012
Make sure your Android emulator is running. Else, you will not be able to even find the database file.
In Eclipse, go to Window > Show View > Other, then choose File Explorer (it has an Android icon).
Within the File Explorer tab, the database file of your app is located in
/data/data/[package]/databases/
Highlight the database file and click the icon on the upper right that looks like a diskette with a tooltip that says “pull a file from the device”.
That should get you your SQLite database file.
Donations appreciated. Every little $ helps. Or click Google +1.









