N
nicosk
Hi all,
i have a table in a website, and using javascript and AJAX i want to
ALTER some cell values. Eg.
my table is:
+-----------------------------------------------------------------------------
+
| Product | Quantity Sold | In Stock |
+-----------------------------------------------------------------------------
+
| Water | 12 |
48 |
| Orange juice | 5 | 55
|
+-----------------------------------------------------------------------------
+
<table id="stockControl">
<tr id="header">
<td>Product</td>
<td>Quantity Sold</td>
<td>In Stock</td>
</tr>
<tr id="tr1">
<td>Water</td>
<td>12</td>
<td>48</td>
</tr>
<tr id="tr2">
<td>orange Juice</td>
<td>5</td>
<td>55</td>
</tr>
</table>
i want to change the values of some cells through an AJAX request
What i did so far is:
(This is what my AJAX request returns)
<script language="Javascript">
var tRow = document.getElementById("tr1'");
var cells = tRow.getElementsByTagName("td");
cells[1].innerHTML = "13";
tRow.style.background="#44556e";
</script>
My script even though is visible in my source code, it doesn't seem to
execute.
Any ideas?
i have a table in a website, and using javascript and AJAX i want to
ALTER some cell values. Eg.
my table is:
+-----------------------------------------------------------------------------
+
| Product | Quantity Sold | In Stock |
+-----------------------------------------------------------------------------
+
| Water | 12 |
48 |
| Orange juice | 5 | 55
|
+-----------------------------------------------------------------------------
+
<table id="stockControl">
<tr id="header">
<td>Product</td>
<td>Quantity Sold</td>
<td>In Stock</td>
</tr>
<tr id="tr1">
<td>Water</td>
<td>12</td>
<td>48</td>
</tr>
<tr id="tr2">
<td>orange Juice</td>
<td>5</td>
<td>55</td>
</tr>
</table>
i want to change the values of some cells through an AJAX request
What i did so far is:
(This is what my AJAX request returns)
<script language="Javascript">
var tRow = document.getElementById("tr1'");
var cells = tRow.getElementsByTagName("td");
cells[1].innerHTML = "13";
tRow.style.background="#44556e";
</script>
My script even though is visible in my source code, it doesn't seem to
execute.
Any ideas?