'datatables on click onTD showing undefined and navigating

i have added the code to detect undefined

if(typeof data === "undefined") { 
        // do nothing
      } else {
        window.location.href = data;
      }

but even after showing alert it still going to undefined url why?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source