Mikael's blog

A developers sixth time trying to maintain a blog

Posts tagged with #javascript
Re-sizing Images in Javascript
Uploading files asynchronously with XMLHttpRequest is a neat trick on its own, but what I really wanted was a nice way to upload images from my phone and/or tablet. The problem with this is that technology is evolving quite rapidly these days and m...
written on May 2, 2013 at 19:50 by Mikael Lofjärd
Async File Uploads in HTML5
Uploading files using HTML forms has always felt a bit off for me. You had to set your encoding to `multipart/form-data` and the synchronous nature of form posts always made it a waiting game when uploading larger files. Then came AJAX and the dawn ...
written on May 1, 2013 at 22:30 by Mikael Lofjärd
Search And You Shall Find
Every blog should have a search box. Not because it's necessary, but because it's fun to implement. A few weeks ago I ran across a small Javascript library called Lunr.js. It's basically a small text indexer that can rank search results and it's wri...
written on April 27, 2013 at 00:09 by Mikael Lofjärd
The Gift of Source Code
I'm not sure if anyone is interested in my source code for this blog, but since I've already posted some bits and pieces of it from time to time, I thought, why not release it all? If your browser has a width of more than 720 pixels, you will see a ...
written on December 21, 2011 at 17:00 by Mikael Lofjärd
A Tiny Bug
I've been using (and still am in production) an old JavaScript function called `parseInt` when parsing my DateTimes for comments and posts. For some reason it showed some weird behavior today. I noticed a comment that was written on December 0. I lo...
written on December 10, 2011 at 00:20 by Mikael Lofjärd
Client-side JavaScript Initialization
Yesterday I started using the BundleController with my JavaScript files on the client-side. I also deployed my ViewManager so that all my views now uses the bundled and minified JavaScript file produced when I start (or restart) my Node.js server. T...
written on December 7, 2011 at 22:37 by Mikael Lofjärd
Architecture in JavaScript - Closures
Today is Tuesday, which for me means I've held another tutorial at work. Today it was less hands-on and more of me just talking and showing examples on the projector using the wonderful jsfiddle JavaScript quick-hack-tool. My talk today was mostly a...
written on December 6, 2011 at 22:53 by Mikael Lofjärd
Handling Views in node.js
This weekend, my wife and daughter have been away up north, visiting my in-laws. I thought this would be a great opportunity for me to buffer up on some blog posts, but it seems like my inspiration mostly left with them. Last Tuesday at my weekly tu...
written on December 3, 2011 at 22:46 by Mikael Lofjärd
Automatic Minification and Bundling with node.js
Scott Guthrie recently wrote about the new minification and bundling process that has been built for ASP.Net 4.5. I read his blog post, liked what I read and then I though of doing the same thing for my blog. I've been looking at minification progra...
written on November 29, 2011 at 22:51 by Mikael Lofjärd
Architecture in JavaScript - Inheritance
There's been a lot of debate over the years about whether JavaScript is an object-oriented language or not. Most of these discussions seem to pan out into arguments over inheritance. JavaScript, by design, lends itself well to inheritance through ex...
written on November 29, 2011 at 22:40 by Mikael Lofjärd
Architecture in Javascript - Modules
About a week ago I wrote about turning client side JavaScript into CommonJS modules. The scoping of variables in CommonJS makes this easy, but what if we wanted to do it the other way around? In CommonJS, modules are scoped by file and all public me...
written on November 24, 2011 at 12:14 by Mikael Lofjärd
The power of CommonJS
A few days ago when I was putting my posts into CouchDB, instead of relying on a static HTML file, I also implemented templating with Mustache. Mustache is small, easy to use and has almost no advanced features. It's power lies in the vast amount of ...
written on November 16, 2011 at 23:44 by Mikael Lofjärd