How can I read the JSON data element value?
<p>I guess this html is right </p>

<pre><code>&lt;span id="tag_8" data-translations="{&amp;quot;en&amp;quot;:&amp;quot;cat&amp;quot;}" class="myTag selected"&gt;chat&lt;/span&gt;at

# generated with : 
#  %span.myTag{:id =&gt; "tag_" + tag_id.to_s, :'data-translations' =&gt; translations(tag_id).to_json}= tag
</code></pre>

<p>I am trying to read the translation from within a jquery script , but it's failing :</p>

<pre><code>selectedTag = $('#tag-list li span.myTag.selected:first')
console.log 'translations: ' + selectedTag.data("translations", "en")
 =&gt;   translations: [object Object]

#however
 console.log 'translations: ' + selectedTag.data("translations")
 =&gt;  translations: {"en"=&gt;"cat"}
</code></pre>
