Checking for href's undefined value

If this check is not present and if any anchor tag does not has href attribute (which its not there in dataTables plugin) then the page was being redirected to "/undefined".