Hashes

[Total: 0    Average: 0/5]

This example demonstrates how to use a HASH.

Body Code:

<script>
function showObj(_obj)
{
 var _s="";
 for(var i in _obj)
 {
  _s+=i+"="+_obj[i]+"<BR>n";
 }
 return _s;
}
function alertMe(){alert("ME");return "return-me";}
var something={1:2,3:4,name:"dirtyHash",alertMe:alertMe()};
document.write("something:<DIR>"+showObj(something)+"</dir>");
document.write("HASH:<BR>1:"+something[1]+"<BR>2:"+something[3]+"<BR>");
document.write("XXXX="+something["alertMe"]+"<BR>");
</script>

Times Viewed: 0

Leave a Reply

Your email address will not be published. Required fields are marked *