This doesn't look right to me, if you're assuming jQuery do you not mean `$(document).ready(function() {` certainly having `{function(){` looks problematic and this snippet doesn't parse in Chrome for me with jQuery 1.9...