Codebeef

Really Simple History (RSH) Initial URL

I recently came across a small problem in RSH whereby on loading a page with a state in the url (e.g. localhost.com/test_page#test) would not trigger the history listener function on it’s initial load. To fix this, I needed to modify my window onload function to include a call to my history listener, as follows:

history_listener: function (newLocation, historyData) { ... },  // Window.onload calls this 

initialize_history: function () {
  dhtmlHistory.initialize();
  dhtmlHistory.addListener(this.history_listener.bindAsEventListener(this));                        

  // Added this line to force a call to my history listener
  this.history_listener(dhtmlHistory.getCurrentLocation()); 
}

This ensures that when the page is freshly loaded, the history listener is called with the contents of our initial location.

Next post

Unterminated String Literal with Asset Packager

A recent release of Bouldr threw a bit of a spanner in the works when the excellent Asset Packager began choking when attempting to create our concatenated and compressed javascript file. It turns out that as I am developing in Windows (gah!), I need to run dos2unix in order to ensure that the js files are in the appropriate file format (our server is running CentOS). In order to automate this process, I added the following to our deploy script:

Read More →