I need to check to see if a variable is null or has all empty spaces or is just blank (\"\").
I have the following, but it is not working:
var addr;
if (addr == null || addr.trim() === ''){ //... }
A null comparison will also catch undefined. If you want false to pass too, use !addr. For backwards browser compatibility swap addr.trim() for $.trim(addr).
null
undefined
false
!addr
addr.trim()
$.trim(addr)