Comunidad de diseño web y desarrollo en internet online

un valor perdido como encontrarlo

Citar            
MensajeEscrito el 04 Ene 2011 05:22 am
Hola buen feliz año nuevo a todos, ahora comenzamos con las dudas quisiera saber como recuperar un valor que se muestra al principio luego ya no solo queda el ultimo.
He cargado un xml diferente nodos, existe un nodo llamado titulo,

Código Javascript :

<script type="text/javascript">


$.ajax({ 
    url: 'http://localhost:8080/SysWebEdu/agendaMes.php', 
    type: 'GET', 
    dataType: 'xml', 
    timeout: 1000, 
    error: function(){ 
        alert('Error loading XML document'); 
    }, 
    success: function(xml){
      var miCss= {
               'border':'3px solid red',
               'background-color' : '#ddd',
                  'font-weight' : '',
                 'color' : 'rgb(0,40,244)',
               'cursor':'pointer'
            }
        var clima=xml;
      var agenda=clima.getElementsByTagName('evento');
         for(var i=0;i<agenda.length;i++){
            evento=clima.getElementsByTagName('evento')[i];
            fecha=evento.getElementsByTagName('fecha')[0].firstChild.nodeValue;
            titulo=evento.getElementsByTagName('titulo')[0].firstChild.nodeValue;
            $("#"+fecha).css(miCss);
            //$("#"+fecha).append(tituagen);
            alert(titulo);
            $("#"+fecha).mouseover(function(event) {
               alert(titulo);
            });
         }
    } 
});
    </script>


Bueno en el xml es:

Código XML :

  <?xml version="1.0" ?> 
- <agenda>
- <evento>
  <idagenda>a0001</idagenda> 
  <titulo>trabajo</titulo> 
  <fecha>4</fecha> 
  <detalles>asdfasd</detalles> 
  </evento>
- <evento>
  <idagenda>a0002</idagenda> 
  <titulo>vacaciones</titulo> 
  <fecha>28</fecha> 
  <detalles>aasdfa dsf asdf asdfasdfasdfasdf asd asdf asd fasdfasd</detalles> 
  </evento>
  </agenda>

espero ser claro
miren primero he creado una tabla y cada td contiene como id una fecha del mes, bien del xml las fechas qe coincidan las cambio de color y quiero agregarle el evento sobre para qe cuando el cursor este encima me muestre el titulo de esa fecha y la verdad solo me muestra el titulo de la ultima fecha..

Gracias de antemano, un saludo desde Peru..

Por FlexandFlash

48 de clabLevel



 

chrome
Citar            
MensajeEscrito el 05 Ene 2011 03:00 pm
que framework usas? para poder reproducir tu problema y haci tener una perspetiva de la solucion

Por tuadmin

Claber

598 de clabLevel



Genero:Masculino  

firefox
Citar            
MensajeEscrito el 05 Ene 2011 03:14 pm
Gracias por tu atencion y tiempo, uso Jquery 1.4

Por FlexandFlash

48 de clabLevel



 

chrome

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.