Let’s lead with code:
PLAIN TEXT
JAVASCRIPT:
-
Namespace(’foo.bar’);
-
foo.bar.myFunction = function() {};
-
Namespace(’com.example’, {
-
MyClass: function() { return {}; }
-
});
-
var obj = new com.example.MyClass();
-
Namespace.use(’com.example.MyClass’);
-
var obj2 = new MyClass();
-
// include com/example/RemoteClass.js
-
Namespace.include(’com.example.RemoteClass’);
-
var obj3 = new com.example.RemoteClass();
-
Namespace.registerNativeExtensions();
-
‘com.foo.bar’.namespace();
Reading the code above is probably all you need to know about the new, library independant, JavaScript library Namespace.js, created by Maxime Bouroumeau-Fuseau.
The goals for the library are:
- Simple API
- Framework independent
- Remote file loading (synchronously or async)
- Tested against Firefox 3.x, Safari 3.x, IE 6/7 and Opera 9.5
- Highly configurable
- Events
- Optionally add methods to native objects
You can see more in the How To.
admin Javascript, Libraries Javascript, libary, Namespace.js:
Allan Jardine is up to his old tricks again (his tricks are: creating helpful small tools!). This time he has created KeyTable, a library that adds the ability to use the keyboard to navigate around an HTML table.
Events can be bound (and unbound) to cells as required by the developer, allowing increased accessibility to Javascript enhanced tables. This library is somewhat similar to QFocuser that was posted on Ajaxian back at the start of the month, but specialises in table navigation. KeyTable also integrates nicely with DataTables, such that paging and sorting is taken into account.
To get started you just need to var keys = new KeyTable(); and then you can add init params for fine grained work, and you can also add events:
PLAIN TEXT
JAVASCRIPT:
-
/* Example event listener */
-
keys.event.focus( 1, 3, function() {
-
/* processing on cell 1,3 … */
-
} );
-
/* this is exactly the same as */
-
keys.event.focus( $(’#example tbody tr:eq(3) td:eq(1)’)[0], function() {
-
/* processing on cell 1,3 … */
-
} );
The front page has an example that uses jEditable allowing you to mouse around, hit enter, change a field, and go back:

admin Javascript, Libraries Javascript, keyboard, table
Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!
admin ASP.Net, Advertising, Announcement, Audio, Backgrounds, Best of the Web, Browsers, Brushes, Business, Buttons, C/C++, CSS/Style Sheets, Charts, Chat, Client Softwares, Code, Codes and Scripts, Color, Contacts and Networking, Databases, Demo Tour, Doctype, E-commerce, Education and Learning, Events, Extras, File and Data Sharing, Forms, Framework, Frameworks and Platforms, Freelance, Graphic Design, Hosting, Icons, Image Tools, Information, Inspiration, Legal Documents, Libraries, Linux, MSSQL, Money Making, MySQL, Open-Source, Operating Systems, Optimization, Polls and Surveys, Project Management, Projects, Reviews, Rss/feeds, Ruby/Rails, SQL, Script Library, Search Engine Marketing and Optimisation, Search Engine Optimization, Security, Silverlight, Social, Social Media Websites, Sound, Stats, Stock Photography, Stock Photos, System Administration, Testing, Tips and Tricks, Uncategorized, Webmail, color Schemes, content management system, contest, css, eCommerce