Converting hashmap into javascript object
<p>I am trying to convert a hashmap into a object of javascript and then I am passing a key i.e., property of object and want to retrive the value of it;
Hashmap mcl = {AB=1,BC=2,DE=3} .Now when I am sending the value AB then it giving outputbut when  I am passing BC or DE its not. Can any one suggest on it?</p>

<pre><code>function getCount(key)
        {

            var map='&lt;%=mcl%&gt;';

            var nmap=new Object();
            var z=map.substr(1, map.length-2);

            var y=z.split(',');
            for(var i=0;i&lt;y.length;i++)
            {
                var k=y[i];
                var m=k.split("=");
                nmap[m[0]]=m[1];
            }
            alert(nmap[key])
        }
</code></pre>
