Computed properties in Backbone

I am using a combination of the initialize() function together with change event listeners to update derived attributes. The idea is first to compute the attributes on model initialization, and second to let the model listen to its own changes and update the attributes accordingly. My solution looks roughly like this: MyModel: Backbone.Model.extend({ initialize: function() … Read more

Client-side Javascript app – url routing with no hash tag

In Ember.js (version 1.0.0rc3) this can be accomplished by using the Ember.js location API: App.Router.reopen({ location: ‘history’ }); And then setting the web server to redirect traffic to the Ember application. To give a concrete example here is a basic Apache .htaccess file redirecting traffic to the Ember application located in index.html: RewriteEngine on RewriteCond … Read more

Is there anyway to detect OS language using javascript?

There is no cross-browser way to do this. Internet Explorer supports the following: navigator.browserLanguage: browser language navigator.systemLanguage: Windows system language navigator.userLanguage: Windows user-specific language But there is no way to access these settings from any other browsers (that I can tell) so don’t use them: stick to the standard navigator.language (corresponding to the browser language) … Read more