Jquery Check For Undefined In Javascript