Execute HTML5 data- string as JavaScript (without eval)?
<p>I have the following div:</p>

<p><code>&lt;div id="foo" data-callback="function(){console.log(1)}"&gt;&lt;/div&gt;</code></p>

<p>I want to be able to execute the div's callback string as a JavaScipt function like this:</p>

<p><code>($('#foo').data('callback'))()</code></p>

<p>But this obviously won't work. Is there any way to do this?</p>

<p>Here's a <a href="http://jsfiddle.net/CXfaw/" rel="nofollow">JSFiddle</a>.</p>
