Convert data- string into an object?
<p>Thinking along the lines of using language resources (especially in SharePoint), I want to bind the text of my HTML tags to a value in one of my resource JavaScript objects (SharePoint has a handler that will do this). I would like to do something like this:</p>

<p>HTML: </p>

<p><code>&lt;div id="helloMessage" data-stringResource="helloString" /&gt;</code></p>

<p>JS: </p>

<pre><code>  $('div').each(function() {
      $(this).text(SP.Publishing.Resources. + $(this).attr('data-stringResource'));
  });
</code></pre>

<p>Ideally, what I would want that to is in that text function pass in <code>SP.Publishing.Resources.helloString</code>. I think I can use <code>eval()</code> to accomplish this, but I read everywhere it's evil. Is there anything I can do?</p>
