fixed calling external javascript and passing null as an argument.
note: typeof(null)=='object', typeof(undefined)=='undefined'