I am newbie to JavaScript.I have a problem in display objects within objects in my example shown below.I am not able to display the objects content.
var nameList={
n1:{
name:"PRS POP",
section:211,
rollNo:211,
},
n2:{
name:"steve XYZ",
section:32,
rollNo:359,
}
}
function display_proc()
{
var x=0;
var objProp;
for(objProp in nameList){
if(nameList.hasOwnProperty(objProp)){
for(var obj in nameList.objProp ){
if(nameList.objProp.hasOwnProperty(obj)){
document.writeln(obj);
}
}
}
}
}
display_proc();