Jeg er ikke helt med ! Hvordan skal jeg ligge dine info. ind !
<html>
<head>
<script>
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async="false";
xmlDoc.load("Data.xml");
nodes=xmlDoc.documentElement.childNodes;
nodesl=nodes.length;
var Tal1
var Tal2
var Tal3
var starnr = nodesl - 6;
function TalValg(){
Tal1 = Math.floor(Math.Random()*starnr) + 1
Tal2 = Math.floor(Math.Random()*starnr) + 1
Tal3 = Math.floor(Math.Random()*starnr) + 1
if(Tal1 == Tal2){
Tal2 = Tal2 -1;
}
else if(Tal2 == Tal3){
Tal3 == Tal3 -2;
}
document.getElementById("News1").innnerHTML= Nodes[Tal1].childNodes[1].text + '<br>' + Nodes[Tal1].childNodes[2].text + '<br>' +Nodes[Tal1].childNodes[3].text
//osv.
}
//Den er ikke 100% sikker men den minimerer den matematiske sandsynlighed
</script>
</head>
<body bgcolor="blue">
<h1>xml news eks.</h1>
<xml id="news1" src="data.xml"></xml>
<table border="1" bgcolor="yellow">
<tr align="left"><th>dato:</th><td id="dato"></td></tr>
<tr align="left"><th>headline:</th><td id="headline"></td></tr>
<tr align="left"><th>subheadline:</th><td id="subheadline"></td></tr>
<tr align="left"><th>smalltext:</th><td id="smalltext"></td></tr>
<tr align="left"><th>content:</th><td id="content"></td></tr>
</table>
</body>
</html>
Du har mit text xml her :
<?xml version="1.0" encoding="ISO-8859-1"?>
<allnews>
<news id="12">
<dato>12/12/02</dato>
<headline>headline 12 text eksempel</headline>
<subheadline>subheadline 12 text eksempel</subheadline>
<smalltext>smalltext 12 text eksempel</smalltext>
<content>content 12 text eksempel</content>
<file type="gif">pic12.gif</file>
</news>
<news id="11">
<dato>11/12/02</dato>
<headline>headline 11 text eksempel</headline>
<subheadline>subheadline 11 text eksempel</subheadline>
<smalltext>smalltext 11 text eksempel</smalltext>
<content>content 11 text eksempel</content>
<file type="gif">pic11.gif</file>
</news>
<news id="10">
<dato>10/12/02</dato>
<headline>headline 10 text eksempel</headline>
<subheadline>subheadline 10 text eksempel</subheadline>
<smalltext>smalltext 10 text eksempel</smalltext>
<content>content 10 text eksempel</content>
<file type="gif">pic10.gif</file>
</news>
<news id="9">
<dato>09/12/02</dato>
<headline>headline 9 text eksempel</headline>
<subheadline>subheadline 9 text eksempel</subheadline>
<smalltext>smalltext 9 text eksempel</smalltext>
<content>content 9 text eksempel</content>
<file type="gif">pic9.gif</file>
</news>
<news id="8">
<dato>08/12/02</dato>
<headline>headline 8 text eksempel</headline>
<subheadline>subheadline 8 text eksempel</subheadline>
<smalltext>smalltext 8 text eksempel</smalltext>
<content>content 8 text eksempel</content>
<file type="gif">pic8.gif</file>
</news>
<news id="7">
<dato>07/12/02</dato>
<headline>headline 7 text eksempel</headline>
<subheadline>subheadline 7 text eksempel</subheadline>
<smalltext>smalltext 7 text eksempel</smalltext>
<content>content 7 text eksempel</content>
<file type="gif">pic7.gif</file>
</news>
<news id="6">
<dato>06/12/02</dato>
<headline>headline 6 text eksempel</headline>
<subheadline>subheadline 6 text eksempel</subheadline>
<smalltext>smalltext 6 text eksempel</smalltext>
<content>content 6 text eksempel</content>
<file type="gif">pic6.gif</file>
</news>
<news id="5">
<dato>05/12/02</dato>
<headline>headline 5 text eksempel</headline>
<subheadline>subheadline 5 text eksempel</subheadline>
<smalltext>smalltext 5 text eksempel</smalltext>
<content>content 5 text eksempel</content>
<file type="gif">pic5.gif</file>
</news>
<news id="4">
<dato>04/12/02</dato>
<headline>headline 4 text eksempel</headline>
<subheadline>subheadline 4 text eksempel</subheadline>
<smalltext>smalltext 4 text eksempel</smalltext>
<content>content 4 text eksempel</content>
<file type="gif">pic4.gif</file>
</news>
<news id="3">
<dato>03/12/02</dato>
<headline>headline 3 text eksempel</headline>
<subheadline>subheadline 3 text eksempel</subheadline>
<smalltext>smalltext 3 text eksempel</smalltext>
<content>content 3 text eksempel</content>
<file type="gif">pic3.gif</file>
</news>
<news id="2">
<dato>02/12/02</dato>
<headline>headline 2 text eksempel</headline>
<subheadline>subheadline 2 text eksempel</subheadline>
<smalltext>smalltext 2 text eksempel</smalltext>
<content>content 2 text eksempel</content>
<file type="gif">pic2.gif</file>
</news>
<news id="1">
<dato>01/12/02</dato>
<headline>headline 1 text eksempel</headline>
<subheadline>subheadline 1 text eksempel</subheadline>
<smalltext>smalltext 1 text eksempel</smalltext>
<content>content 1 text eksempel</content>
<file type="gif">pic1.gif</file>
</news>
</allnews>
Hvordan skal billedet ligges ind ?
Kan du hjælpe mig det sidste stykke vej ?
Jeg fandt lige noget det ligner det jeg vil opnå !
se her
http://www.maximumasp.com/Default.aspx?bhcp=1/lars