How do I get the correct number from this data url ?
<a href="#" id="number" data-number="106454129446370134989">click me</a>
$(function(){
$('#number').click(function(e){
e.preventDefault();
var number= $(this).data('number');
alert(number);
//106454129446370130000
})
edit: seems .data() has some strange behaviour. Solved it by adding || around the number and stripping it later.
edit2: problem was with jquery 1.7 branch. 1.9 works :-)
$().dataauto-converts the string to a number, in some browser or version of jQuery? I agree that I couldn't reproduce that behavior, but if that is what's happening, the OP could get around this by adding a non-numeric character to the start or end of the value, and then stripping it after retrieval.