My HTML:
<a id="link" class="linkRedirect" data-href="">Download Link</a>
I am getting incorrect value for $("#link").data("href") when clicked multiple times.
Click Handler:
$(document).on("click", "#link", function (e) {
var url = $("#link").data("href");
//check validation
if(true) location.href = url;
});
The file in the url will be downloaded only if the session is valid.
You could rather use it like this:
then ins your jquery, use this: