Sé que hay un objeto Hash() en el marco de prototipo Javascript, pero ¿hay algo en Jquery como este?¿Cómo crear el objeto/matriz Hash usando jquery?
Como me gustaría seguir con un framework javascript, en lugar de mezclar el trabajo Prototype Frame y el framework JQuery y usarlo al mismo tiempo, ya que me preocupa que haya conflicto y cree efectos secundarios.
Así que mi pregunta es: ¿cómo crear Hash objeto/matriz utilizando jquery?
Aquí es mi función:
/* prototype framework, I want to change this to jQuery! */
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);
}
}
Gracias, es compacto y muy útil. – arturaz