Use `href` insteaf of `href.legnth` to check if `href` exists

`if(var)` is simpler and more reliable than `if(var.length)`. D'oh!