• using object[property]
  • using push & join to enhance performance
function printp(data){
	var buffer=[];
	for(var n in data)
			buffer.push(n+":"+data[n]); 
	var doc = document.getElementById("p");
	if(doc!=undefined)
		doc.innerHTML = buffer.join(",");
}
Advertisements