I'm using the html5 "data" attribute on a element, and I want to assign the attribute value to a variable only if it exists and if it's not empty:
var xxx = $(this).data('what') ? $(this).data('what') : 'default_value';
but it doesn't work. I always get the default value...