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..
