Skip to content
Snippets Groups Projects
Commit 3fb47bdc authored by Fitzsimons, Thomas (UG - Comp Sci & Elec Eng)'s avatar Fitzsimons, Thomas (UG - Comp Sci & Elec Eng)
Browse files

final1

parent 97401821
No related branches found
No related tags found
No related merge requests found
No preview for this file type
...@@ -115,3 +115,4 @@ Setup scripts are provided for Mac, Linux and Windows. You can run the appropria ...@@ -115,3 +115,4 @@ Setup scripts are provided for Mac, Linux and Windows. You can run the appropria
- start.sh - start.sh
- start.ps1 - start.ps1
- start.bat - start.bat
\ No newline at end of file
{"medicines": [{"name": "Elixirium", "price": 5.99}, {"name": "Cureallium", "price": 7.49}, {"name": "Healix", "price": 4.99}, {"name": "Restorix", "price": 12.99}, {"name": "", "price": 15.49}, {"name": "Tonicast", "price": null}, {"name": "Allevium", "price": 19.99}, {"name": "Synthomaxi", "price": 14.99}, {"name": "Magicure", "price": 200.0}, {"name": "Paracetamol", "price": 2.0}, {"name": "Ibuprofen", "price": 3.99}, {"name": "Asprin", "price": 4.99}]} {"medicines": [{"name": "Elixirium", "price": 5.99}, {"name": "Cureallium", "price": 7.49}, {"name": "Healix", "price": 4.99}, {"name": "Restorix", "price": 12.99}, {"name": "", "price": 15.49}, {"name": "Tonicast", "price": null}, {"name": "Allevium", "price": 19.99}, {"name": "Synthomaxi", "price": 14.99}, {"name": "Magicure", "price": 200.0}, {"name": "Paracetamol", "price": 7.99}]}
\ No newline at end of file \ No newline at end of file
...@@ -17,10 +17,12 @@ async function fetchData() { ...@@ -17,10 +17,12 @@ async function fetchData() {
data.forEach((medicine) => { data.forEach((medicine) => {
const row = document.createElement("tr"); const row = document.createElement("tr");
const name = document.createElement("td"); const name = document.createElement("td");
name.textContent = medicine.name || "N/A"; /*name.textContent = medicine.name || "N/A";*/
name.textContent = medicine.name;
row.appendChild(name); row.appendChild(name);
const price = document.createElement("td"); const price = document.createElement("td");
price.textContent = medicine.price !== null ? `$${medicine.price.toFixed(2)}` : "N/A"; /*price.textContent = medicine.price !== null ? `$${medicine.price.toFixed(2)}` : "N/A";*/
price.textContent = medicine.price;
row.appendChild(price) row.appendChild(price)
tblBody.appendChild(row); tblBody.appendChild(row);
......
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment