Category Archives: JavaScript

HTML/DOM attribute change events and how it can improve maintainability in your web application

Do you find yourself in an unmaintainable mess where there’s DOM manipulation calls in every part of the code? Would it not be easier to simply set an attribute f.ex. data-progress=”50″ and then see the elements change automatically (seemingly by … Read more

Posted in JavaScript, jQuery | Leave a comment

Simple helping function for managing dependencies in JavaScript

Here’s a very simple helping function that can be used to manage arbitary dependencies in your script. The dependency check is defined with a callback so you can write dependencies for when DOM is loaded, a script is ready or … Read more

Posted in JavaScript | 1 Comment

Possible issue when omitting semi-colons in JavaScript

In my latest JavaScript projects I’ve tried to omit the semi-colon (;) on line endings. Why? I don’t know, because I can? I’m not going to go into a deep discussion about this subject here but rather warn others who … Read more

Posted in JavaScript | Leave a comment

How I implemented currency handling in Mustache across PHP and JavaScript

Originally this article was to be about how to implement currency formatting using the template language Mustache, but I see it also covers a bit on how to synchronize template variables between the server-side and client-side. Hopefully you’ll get something … Read more

Posted in JavaScript, Mustache, PHP, Programming | Leave a comment