Advertisement

Can anyone tell me why this script doesn't work?

Moderators: Calcifer, slothy

Can anyone tell me why this script doesn't work?

Postby midasal » Fri Dec 08, 2006 3:14 pm

I've copied a tutorial off the w3c site, but I've obviousle messed something up?

1) Can anyone spot the mistake in this code?
2) Can anyone explain what async="false" means?

Thanks!

<html>
<head>
<script type="text/javascript">
function movenext()
{
x=document.getElementById('xml1').recordset
if (x.absoluteposition < x.recordcount)
{
x.movenext()
}
}

</script>

</head>

<body>

<xml id="xml1" async="false">
<newsarticles>
<item>
<title>Title 1</title>
</item>
<item>
<title>Title 2</title></item>
<item>
<title>Title 3</title></item>
<item>
<title>Title 4</title></item>
<item>
<title>Title 5</title></item>
<item>
<title>Title 6</title>
</item>
<item>
<title>Title 7</title></item>
<item>
<title>Title 8</title></item>
<item>
<title>Title 9</title></item>
<item>
<title>Title 10</title></item>
<item>
<title>Title 11</title>
</item>
<item>
<title>Title 12</title></item>
<item>
<title>Title 13</title></item>
<item>
<title>Title 14</title></item>
<item>
<title>Title 15</title></item>
</newsarticles>
</xml>
<table id="newsitems" datasrc="#xml1" datapagesize=1>
<thead>
<tr><th>Title</th><th>URL</th></tr>
</thead>
<tbody>
<tr>
<td><span datafld="title">gf</span></td>

</tr>
</tbody>
</table>
<input type="button" value="Next"
onclick="movenext()" />
</body>
</html>
[/code]
midasal
 
Posts: 7
Joined: Fri Sep 29, 2006 2:29 pm

Return to Javascript

Who is online

Users browsing this forum: No registered users and 4 guests

cron