I know there is a Hash () object in the structure of the Javascript prototype, but is there anything in jQuery?
As I would like to stick to one javascript framework, instead of mixing Frame Prototype and JQuery framework and using at the same time, as I am worried that there will be conflicts and create side effects.
So my question is: how to create a Hash object or array using jquery?
Here is my function:
var starSaves = new Hash();
function myHover(id, pos)
{
var starStrip = $('star_strip_' + id);
if (starSaves.keys().indexOf(id) == -1)
{
var starSave = new Array();
var imgs = starStrip.select("img")
alert(imgs);
for (var i = 0; i < imgs.length; i++)
{
starSave[starSave.length] = imgs[i].src;
if (i < pos)
imgs[i].src = "/images/star_1.gif";
else
imgs[i].src = "/images/star_0.gif";
}
starSaves.set(id, starSave);
}
}
source
share