having fun with code

Tag Archives: mootools

Mooml 1.2.3 – Bye, bye, with()

Mooml 1.1 was the first version of Mooml that didn’t rely on eval(), a javascript function that causes lot’s of problems when not used properly, but that also prevent minimizers and compilers like Closure to generate valid code. The new Mooml 1.2.3 release also gets rid of with(), which will no longer be used to [...]

Getting unique timestamps in Javascript

Sometimes, when you want to generate unique id’s or similar, it is very common to use the current date as unix timestamp (new Date().getTime() or $time() in Mootools). The problem is that if we get the current timestamp multiple times too fast, it may happen that we get exactly the same value. Actually, this will [...]

Mooml 1.1 – No more eval(), say Hi to Mooml.Template and Mooml.Templates

Mooml 1.1 has been finally released today and made available to everybody via Github and Mootools Forge plugin repository. What is new in Mooml 1.1 Mooml 1.1 has a lot of new features, but these are worth to mention: No more eval() Mooml.Template Mooml.Templates Pass functions as arguments to template functions References to elements with [...]

More updates to Mooml coming soon

I’ve been very busy lately, both with spaniards.es and at work. Too much stuff to do. Nevertheless, I’ve been working lately on a version of Mooml that does not rely on with/eval. The problem of using eval (which has bad reputation but is used every time we parse JSON -unless you use this- or load [...]

Having fun with Mooml & Twitter

Mooml is a templating engine for Mootools. With it, you can create HTML from Javascript using a very clean syntax. Plus, it is extremely useful when you have to generate repeating elements, since Mooml automatically renders arrays of data multiple times. Let’s see an example. Searching Twitter Nowadays there are a lot of APIs out [...]

Mooml.globalize(): Mooml template functions going global

Since version 1.0.9, Mooml includes a new feature: globalize. It maybe handy for some websites to globalize all the Mooml template functions (div, a, p, span…) to the window object scope, so they can be used anywhere in the code without the need of defining or evaluating a template. For example, in normal Mootools code [...]

Detecting when CSS gets loaded by the browser with Mootools and Asset.css

Asset.css claims to have an onload event in Mootools documentation, but sadly, not all browsers support this feature. Even worse, browsers like Chrome seem to support the event, but never fire it. After some research and testing at work, we have come up with a solution that overrides Asset.css to detect when CSS gets loaded [...]

Finally: Singletons, the Mootools way

I have been using for a while the “new new Class” syntax to create singletons on the projects I am working on. This is for many reasons, but specially because I didn’t like other solutions like Class.Mutators, Class.Oclude or extending a plain object with $extend(). Now, after discussing a little bit on the Mootools email [...]

Mooml: Mootools markup language (intro)

It was a month ago when I found about Jaml, an excellent small Javascript library created by Ed Spencer which allows generating HTML code using very nice and clean templates. At work we use Mootools in most of our projects, so I thought it would be nice to improve Jaml by taking advantage of the [...]

I never use $$ on my projects (and barely use $)

On all the projects I’ve worked on, I always try to follow the MVC arquitectural pattern, separating the model from the view *and* creating a controller. It may be a simple controller in charge of a tab-set, or an accordion. Or it may be a full size controller in charge of the whole page structure, [...]

About the blog

This is a blog about development, focused mainly on Javascript but also other languages like python, shell scripts and more.

About the author

Eneko Alonso is a software engineer and UI developer with more than eight years of experience in software and web development. He lives in San Luis Obispo, California and works at LEVEL Studios.

Contact Info

Contact Info