Can't reference keys in returning JSON
<p>I'm returning some JSON from the web server, but I am unable to reference any of the keys.</p>

<pre><code>{"voteid":110.0,"message":"Your request was processed.","success":true}
</code></pre>

<p>Alerting response.message/voteid alerts <code>undefined</code></p>

<pre><code>alert(response.voteid);
</code></pre>

<p>Alerting the full string works fine: <code>alert(response);</code> but that's no good since I want to reference the keys individually. My end goal is to get the voteid key from the JSON and append it to a anchor, which also does not work--with a full string or just a key:</p>

<pre><code>success: function(response) { $(".fav").data("voteid", response.voteid) }
&lt;a class="fav" data-voteid=""&gt;
</code></pre>

<p>On a side note, I don't know why there's a 0 at the end of the voteid. I'm returning the number as a string!</p>

<p><strong>EDIT:</strong> Fixed by setting the dataType to JSON, however, the data will not append to the anchor's data-voteid attribute.</p>

<p><strong>EDIT</strong> Got it to append the id by using .attr instead of .data -- many thanks everyone!</p>
