I have the following tag:
<a href="#" class="Test" data-url="/api/users/unlock">Test</a>
And the following JQuery:
$('a.Test').click(function (e) {
alert(e.data); >> This returns null
jQuery.support.cors = true;
$.ajax({
url: e.data('url'),
type: 'GET',
dataType: 'json',
success: function (data) {
alert(data)
},
error: function () {
alert("Failure!");
}
});
});
Basically, I am trying to use in the Ajax call the url of data-url.
This is not working and when I try alert(e.data) I get null.
What am I doing wrong?
Thank You!