Hi I\'ve got a JSON object provided by an ajax request.
Some of the values inside the json appears as null, but I want an empty String inst
I recommend you the check the return type of the Ajax because it determines how to remove null.
If it is string, you can use this:
data = data.replace(/null/g, '""'); //Stays as string
Or:
data = JSON.parse(data); // Turns to a JSON object
If it is json object, then you can use this:
data = JSON.stringify(data).replace(/null/g, '""'); //Turns to string