Unless you're using jQuery < 1.8 (which ... you shouldn't be), you should be using .on()
:
$(document).on('click','a[data-what="voteThis"]',function(e){
e.preventDefault();
...
});
Also, please do not delegate the click event from the document ... it's horribly inefficient, you should delegate from as close of a parent as possible. Example:
$('.voteTheseContainer').on('click','a[data-what="voteThis"]',function(e){
e.preventDefault();
...
});
And unless you have multiple types of elements that have the data element what
, you can remore the a
qualifier because it does the same thing but is faster:
$('.voteTheseContainer').on('click','[data-what="voteThis"]',function(e){
e.preventDefault();
...
});
Hopefully this helps.