MerusCase
Recent Posts
MooTools Users: Implement a Hash.sort method
I notice that Firefox seems to maintain the order of key:value pairs in objects when iterating over them, while Safari and Chrome seem to sort the object internally (within their respective JS engines). I noticed this especially when making select elements. I store the options as an object, then when drawing the page, I iterate over that object making option elements.
For example, I am making a select box that lists users alphabetically. Users are identified in the database by an id:
var foo = new Element('select').inject($$('body')[0]);
var options = {5082:'User A', 5085:'User B', 5074:'User C'}
$H(options).each(function(name,id){
new Element('option', {text:name, value:id}).inject(foo);
Anyone Want a "Google Wave" Invite? Free to Meruscase Users!
What is a wave?
A wave is equal parts conversation and document. People can communicate and work together with richly formatted text, photos, videos, maps, and movies.
Read More
Leave a Reply