Ver Mensaje Individual
  #5 (permalink)  
Antiguo 06/05/2008, 12:59
Avatar de AbdelioR
AbdelioR
 
Fecha de Ingreso: septiembre-2006
Ubicación: Tarragona
Mensajes: 926
Antigüedad: 17 años, 7 meses
Puntos: 8
Re: error Object has no properties

Parte 2:



Y las funciones que usa son estas:

Código HTML:
<script language="javascript" type="text/javascript">
// Here's how to overwrite default behaviour, using this for demos
Object.extend(Starboxes.options, { rerate: true });

// Create a Youtube style text indicator underneath the stars,
// using starbox custom events
function starboxChangedText(event) {
  var indicator = this.down('.indicator'),
  pick = (event.memo.rating || 0).round() - 1,
  indicator = this.down('.indicator');
  
  // for restoring, store the indicator text on the star if it was not set before.
  this.starboxResetText = this.starboxResetText || indicator.innerHTML;
  
  this.down('.indicator').update([
    'Malo',
	'Nada especial',
	'Vale la pena',
	'Bastante bueno',
	'¡Impresionante!'
  ][pick]);  
}

// here we restore the indicator on mouseout, if needed
function starboxLeftText(event) {
	this.down('.indicator').update(this.starboxResetText || '');
}

function saveStar(event) {
 
  new Ajax.Request('url/votar.php', {
                  parameters: event.memo,
                  method: 'post'
				  });
  $('votar').down('.average').update(event.memo.average);
				  
}

// attach the custom events on DOM loaded
document.observe('dom:loaded', function() {
     
$('votar').observe('starbox:changed', starboxChangedText) // observe the mouseover 
$('votar').observe('starbox:rated', saveStar);
$('votar').observe('starbox:left', starboxLeftText); // observe the mouseout

});

</script> 
Lo único que da error es lo que comento arriba, que aunque en algunos navegadores funciona bien, el firebug hace saltar el error y en IE6 salta un alert también.

A ver si alguien con tiempo ve el error, :)