【发布时间】:2016-08-05 14:55:15
【问题描述】:
这是我使用此脚本检索值的问题
function GetTagValues()
{
// Send the request
jQuery.ajax ( { url:"/usr/private/tags.json.shtm", dataType:"json", success:TagValuesReceived, error:TagValuesError, timeout:10000 });
}
function TagValuesReceived(json)
{
// Update value in webpage
document.getElementById("Tank1").innerHTML = json.Tank1;
//document.getElementById("Pump1Status").innerHTML = json.Pump1Status;
//document.getElementById("Pump1Default").innerHTML = json.Pump1Default;
setTimeout("GetTagValues()", 1000);
}
function TagValuesError()
{
}
GetTagValues();
我想将值放入 td 类值中(用我的新值替换 NO VALUE)
<tr>
<th>
<strong>Flow</strong>
<span class="model">(FL-01011 15°C)</span> :
</th>
<td class="total" id="Tank1">
<input type="text" size="6" value="NO VALUE" />
</td>
<td class="unite">lpm</td>
<td class="today"></td>
</tr>
现在我可以获取要显示的值,但是使用 innerHTML 它改变了值的显示方式(通常在一个框(第二个值)中,如下图所示)
【问题讨论】:
标签: javascript jquery html html-table innerhtml