Using the jQuery UI AutoComplete widget with Knockout

The jQuery UI AutoComplete widget is a nice one to use when the a set of know values is frequently used, like a list of city names, but you still want to leave the end user the capability to enter completely new values. And as can be seen from the examples it’s basic usage is really simple and straightforward, something like: 1: var firstNames = [‘Joe’, ‘Maurice’, ‘Jake’]; 2: $(‘#firstName’).autocomplete({ source: firstNames });   Adding Knockout to the mix Knockout is also a nice data-binding library that is really easy to use. A simple page that lets a user enter … Continue reading Using the jQuery UI AutoComplete widget with Knockout

To SPA or not to SPA

Index: Getting started with AngularJS Creating an AngularJS Controller The AngularJS $scope is not the MVC Model Using repeating elements in AngularJS Filtering the data in an AngularJS ngRepeat element Using the AngularJS FormController to control form submission Creating an AngularJS Directive Using the DOM in an AngularJS application To SPA or not to SPA   Creating Single Page Applications, usually abbreviated to SPA, is getting more and more popular these days. There are some popular applications like GMail or done this way and using frameworks like AngularJS or routing libraries like Director and Sammy it appears quite easy … Continue reading To SPA or not to SPA

Displaying local times using the HTML5 <time> element and Moment.js

One common problem with displaying local dates an times in a browser is that you get no information about the current time zone a browser is in. The browser will tell you the preferred language through the Accept-Language HTTP header but there is no such header for the users time zone. This means that it is easy enough to display a DateTime in the servers time zone but not in the users time zone. Now if your server is in the same time zone as your users this isn’t much of an issue.. However that is quite often not the … Continue reading Displaying local times using the HTML5 <time> element and Moment.js

Practical HTML5

The slides from my presentation on Practical use of HTML5 for the DotNed user group.   Practical html5 from Maurice Beijer     The source code can be found here.   There is an online demo version hosted on Azure websites here.   Enjoy!

jQuery UI and Windows 8 and Internet Explorer 10 touch screens

I recently did a blog post describing how to enable the jQuery UI drag effects. In this post I showed how to get the draggable effect to work on an iPad. While that works just fine it isn’t the end of the story. Microsoft has shipped Windows 8 and Internet Explorer 10 and the jQuery UI draggable effect doesn’t work there as is.   The solution Fortunately the solution is a lot simpler and doesn’t require an additional plug-in. It turns out that Internet Explorer 10 has quite a good support for pointer and gesture events. What we need to … Continue reading jQuery UI and Windows 8 and Internet Explorer 10 touch screens

jQuery UI and touch screens

I really like using jQuery UI in my web applications. But even though jQuery UI is very well tested there are some potential issues to keep in mind. One of those is using the jQuery UI controls on touch devices like the iPad. With these touch enabled devices becoming more and more popular support is quite important if you don’t know you exact client configuration. And for that matter, even if you client has standardized on a specific browser, let say Internet Explorer 9 for example, you may notice that there are in fact lots of other “unofficial” devices being … Continue reading jQuery UI and touch screens

Using CDN’s to speed up your websites

One of the easy ways of speeding up a web application is by using a CDN or content delivery network. The main purpose of a CDN is serving up resources that are not specific to you site. The quintessential example of using a CDN is jQuery. There are many websites using jQuery, according to some statistics some 50% of all websites. And if each site hosts its own copy of jQuery everyone has to download it multiple times. How often depends but assuming everyone does a perfect job of adding cache settings and browsers have plenty of space to cache … Continue reading Using CDN’s to speed up your websites

Using jQuery from an HTML5 Web Worker

jQuery is one of the most useful frameworks out there for web development. And while most of jQuery is very much about working with the browser DOM there is also another side to it that makes doing networking real easy and that is all based around the $.ajax() and related, like the $.getJSON(), functions. Now HTML5 contains a real useful part in Web Workers for doing work that should not block the background thread. And using the XMLHttpRequest for network IO is fine in a Web Worker. Unfortunately however working with the DOM is not ok in the Web Worker, … Continue reading Using jQuery from an HTML5 Web Worker