Just diving into the world of json!
Encountered a small problem.
I have a feed that returns the string "undefined" if there is no data for commentnotes.
I simply want to get rid of the "undefined" and make it empty instead.
Below is my JavaScript code:
document.getElementById("tooltipwrap0").innerHTML = '<span style="font-size:22px; font-weight:600;">' + data.users[0].member + " " + data.users[0].party + "-" + data.users[0].state + "<br/>" + '<span style="font-size:18px; font-weight:300;">' + (data.users[0].commentnotes || "") + "";
Here is a snippet of my data feed:
var data={
"users": [
{
"member": "first name",
"party": "F",
"state": "Ala.",
},
Any assistance would be greatly appreciated, thank you!