javascript - Unable to get property 'stringify' of undefined or null reference -


i getting error after ajax call fails , i'm trying log error object stringifying , saving sesssionstorage. site not in compatibility view or enterprise mode, ie11 , doctype <!doctype html>, document mode edge , user agent string default. happening once in blue moon it's hard track down happening. haven't been able error being thrown yet, create own string catches details of error need , able move forward.

has else run situation json should available isn't? again, doctypes/compatibility settings fine , happens once in blue moon.

read stringify here.

the cause of problem try call stringify method of variable null reference or undefined. make sure not case, validate value valid json:

function isnullorundefined(param) {     return (!param); } 

then before call stringify foo:

if (!isnullorundefined(foo)) {     //some code involving foo.stringify } 

Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -