I have a MySQL BIGINT that I am storing in HTML5 data. Then I'm trying to access that value and pass it through an AJAX call.
<div data-id=211285677671858177>
And the JavaScript:
var send_data = {
id: '' + $(this).data('id')
}
$.post('/send.php', send_data);
The issue is that the jQuery data
function seems to retrieve that value as a floating point and not a string. So appending it to a blank string isn't helping because it's already too late - it's already been rounded (in this case to 211285677671858180
). What can I do to fix this?