var obj = {
"Ethernet": "Up",
"Ethernet": "Down",
"USB_Dongle": "Down",
"USB_Dongle": "Down",
"X_BROADCOM_COM_PPTPAC": "Down",
"wanLink": "Up"
}
function renderStatusWanLink(obj) {
var tmp = jQuery('#WAN_Line').html();
console.log(tmp);
if (obj !== false) {
jQuery('#WAN_Line').html(obj.wanLink);
}
}
renderStatusWanLink(obj);
renderStatusWanLink(obj);
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
<table class="az-table az-table-status table table-condensed table-hover table-striped">
<tbody>
<tr>
<td>WAN Status</td>
<td>:</td>
<td id="WAN_Line" width="49%"></td>
</tr>
</tbody>
</table>
I am trying to get the html/text content first from inside the div #WAN_Line. initially it will be empty. but then next time it should return me some value as it been updated. but it always returns empty.
HTML: (this is inside one table)
<tr>
<td>WAN Status</td>
<td>:</td>
<td id="WAN_Line" width="49%"></td>
</tr>
Javascript:
function renderStatusWanLink(obj)
{
var tmp = jQuery('#WAN_Line').html();
console.log(tmp);
if (obj !== false) {
jQuery('#WAN_Line').html(obj.wanLink);
}
}
obj =
{"Ethernet":"Up",
"Ethernet":"Down",
"USB_Dongle":"Down",
"USB_Dongle":"Down",
"X_BROADCOM_COM_PPTPAC":"Down",
"wanLink":"Up"}