First off, my apologies if this is already addressed in another post - I'm sure it is, but I have not been able to figure it out.
Second, I have a PHP page that outputs an array in a JSON format like this:
[{
"chemical":"Corrosion_Inhibitor",
"TargetDose":81,
"AppliedDose":26,
"ppbbl":"$0.97"
},
{
"chemical":"Scale_Inhibitor",
"TargetDose":56,
"AppliedDose":63,
"ppbbl":"$1.00"
},
{
"chemical":"Biocide",
"TargetDose":55,
"AppliedDose":55,
"ppbbl":"$0.30"
},
{
"chemical":"Friction_Reducer",
"TargetDose":23,
"AppliedDose":44,
"ppbbl":"$0.42"
}]
I would like to pass that array to a variable tableData
in JavaScript so that I can populate a table on another PHP page. Any guidance would be greatly appreciated. Clearly I am not an expert in either of these languages.