Thank you for your response... you helped me!
Heres my working version with a XML redout:
The HTML CODE:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<title>XML readout and text animation</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
//This script does the following
//It shows and hides some XML test. The first output ist normal text, the second output is a weblink.
//The first text fadesOut after some time and the second text fadesIn and stops. No more fading.
//On each refresh there is only one random text selected from the XML file.
// Set values for max and min - how many XML id in file linkData.xml
var maxVal = 2;
var maxMin = 0;
//Read the XML file. Get random var from val max-min. Read only one ID from XML file. Then pass values to function animateOutput
$.get('linkData.xml', null, function (data, textStatus) {
var whatID = Math.round((Math.random()*(maxVal-maxMin)));
var ausgabeText = ( $(data).find('ethLinks [id='+whatID+'] title').text());
var ausgabeLink = ( $(data).find('ethLinks [id='+whatID+'] titleLink').text());
var ausgabeURL = ( $(data).find('ethLinks [id='+whatID+'] url').text());
animateOutput(ausgabeText,ausgabeLink,ausgabeURL);
}, 'xml');
//Gets values from XML readout and animates text.
function animateOutput(ausgabeText,ausgabeLink,ausgabeURL) {
$("#textDisplay")
.hide()
.text(ausgabeText)
.fadeIn('fast')
.delay(3000)
.fadeOut('fast', function() { $(this).html('<a href="'+ ausgabeURL + '"target="_self" title="Sehen Sie die Arbeiten für: ' + ausgabeLink + '">' + ausgabeLink + '</a> und E,T&H.'); } )
.fadeIn('fast');
}
</script>
</head>
<body>
<div id="textDisplay"></div>
</body>
</html>
and the XML file code:
<?xml version="1.0" encoding="iso-8859-1"?>
<ethLinks>
<link id="0">
<title>Am Bodensee sind wir ganz in unserem Element.</title>
<titleLink>Badhütte Rorschach</titleLink>
<url>http://www.apple.com</url>
</link>
<link id="1">
<title>Manchmal möchte man in die Luft gehen.</title>
<titleLink>Ballonclub Alpenrheintal</titleLink>
<url>http://www.orf.at</url>
</link>
<link id="2">
<title>Auf öde Konferenzäume pfeifen wir.</title>
<titleLink>CONDFERENCE ARENA</titleLink>
<url>http://www.dell.com</url>
</link>
</ethLinks>
Great help