I have small requiment, here I'm getting values to the table dynamically. Some times few fields returns some null/blank values. If it gives null values showing error message like "worderId[i].childNodes[0] is undefined"
Please help me how to assign some default values to the null values.
if(worderId.length>0)
{
WOTableData= "<table cellpadding='0' cellspacing='1' border='0' width=100% class='display' id='WOData' ><thead><tr id='row1'><th> </th><th>worderId</th><th>wostatus</th></thead><tbody>";
var technologyImage="";
for(i=0;i<worderId.length;i++)
{
if (!worderId[i].childNodes || !worderId[i].childNodes.length || !worderId[i].childNodes[0].nodeValue) {
worderId[i].childNodes =="---";
}
WOTableData=WOTableData+"<tr title='"+worderId[i].childNodes[0].nodeValue+"</td><td>"+ worderId[i].childNodes[0].nodeValue+"</td><td>"+wostatus[i].childNodes[0].nodeValue+"</td></tr>";
}
WOTableData=WOTableData+"</tbody></table>";
document.getElementById("WODataDiv").innerHTML = WOTableData;
}