use location.href instead of .location.href