Search code examples
jqueryajaxshort

jquery ajax: shortform for $(this).attr('data-ajax-link')?


I've heard there is a better way to query the "data-ajax-link" attribute of some element.

I'm using this right now: $(this).attr('data-ajax-link')

What's the shortform of this? Googled it quickly but couldn't find the answer. Thank you.


Solution

  • Here it is:

    $(this).data('ajax-link')