title: Add KO "data-bind" attribute on $(document).ready
body: <p><strong>Preface</strong></p>
  
  <p>I've rarely ever been a JS developer and this is my first attempt at doing something with Knockout.js. The question to follow likely illustrates both points.</p>
  
  <p><strong>Backgound</strong></p>
  
  <p>I have a fairly complex MVC3 application that I'm trying to get to work with KO (v2.0.0.0). My MVC app is designed to generically control which fields appear in the view (and <em>how</em> they are added to the view). It makes use of partial views to decide what to draw in the view based on the user's permissions (If the user is in group A then show control A, if the user in group B then show control B <em>or possibly</em> if the user is in group A don't include the control at all). Also, my model is <strong>very</strong> flat so I'm not sure the built-in ability to apply my ViewModel to a specific portion of the view will help.</p>
  
  <p>My solution to this problem is to provide an action in my controller that responds with an object in JSON format with that contains the JQuery selector and the content to assign to the "data-bind" attribute and bind the ViewModel to the View in the <code>$(document).ready</code> event using the values provided.</p>
  
  <p><strong>Failed Proof-of-concept</strong></p>
  
  <p>My first attempt at proving that this works doesn't actually seem to work, and by "doesn't work" I mean it just doesn't bind the values at all (as can be seen in <a href="http://jsfiddle.net/kc39u/3/" rel="nofollow">this jsfiddle</a>). I've tried it with the <code>applyBindings</code> inside of the <code>ready</code> event and not, but it doesn't seem to make any bit of difference.</p>
  
  <p><strong>Question</strong></p>
  
  <p>What am I doing wrong? Or is this just not something that can work with KO (though I've seen at least one example online doing the same thing and it <em>supposedly</em> works)?</p>
  
  <p>Like I said in the preface, I've only ever pretended to be a JS developer (though I've generally gotten it to work in the past) so I'm at a loss where to start trying to figure out what I'm doing wrong. Hopefully this isn't a real noob question.</p>