I have a Django view that will return JSON data depending on what is given to it. Each JSON element will have the same fields but the returned JSON array will have a dynamic amount of elements.
Here is an example of the possible JSON data that could be returned:
[
{
"Open Job Lines": 0,
"Open Hours": 0,
"Repair Order": "123454",
"Expected Pay": 1.9,
"Actual Pay": 1.0,
"Pay Status": "Underpaid"
}
]
Here is an example or a JSON return with multiple elements:
[
{
"Open Job Lines": 0,
"Open Hours": 0,
"Repair Order": "123454",
"Expected Pay": 1.9,
"Actual Pay": 1.0,
"Pay Status": "Underpaid"
},
{
"Open Job Lines": 0,
"Open Hours": 0,
"Repair Order": "123454",
"Expected Pay": 1.9,
"Actual Pay": 1.0,
"Pay Status": "Underpaid"
}
]
Using JavaScript, I would like to turn this into HTML similar to following and assign it to a variable.
Open Job Lines: 0 <br>
Open Hours: 0 <br>
Repair Order: 123454 <br>
Expected Pay: 1.9 <br>
Actual Pay: 1.0 <br>
Pay Status: Underpaid <br>
Open Job Lines: 0, <br>
Open Hours: 0 <br>
Repair Order: 123454 <br>
Expected Pay: 1.9 <br>
Actual Pay: 1.0 <br>
Pay Status": Underpaid <br>