I'm a bit of a noob at jquery, so would appreciate some help if possible.
I am making some changed to a link, by taking the content of a data tag and inserting it into the href tag.
This seems to work ok at the moment but I'd like to ensure that both exist before carrying out the function. Can anyone advise?
- var gotoOutPage = function (e) {
pd(e);
var url = $(this).data('url');
$(this).attr("href", url)
window.location = $(this).attr('href');
}
Thanks in advance.