Syntax-Error
01-29-2005, 02:02 AM
ok this is a little confusing but i'll to my best to explain.
I am making a completely client side, but very simple bloging script. It uses JavaScript to parse the XML, then assign the values of it to HTML elements. I have this part working fine. I am now attempting to create a form button that changes the blog entry to the one lower down in the xml file (as in a previous entry). This will make more since if you look at the files. I used a for next loop, and everything looks fine to me, but of couse, it doesnt work. Please take a look and see if you can find a problem. The html is attached to this post, and the xml file is below (can't attach .xml to a post). Thanks.
The XML:
<?xml version="1.0" ?>
<blog>
<note>
<to>third to</to>
<from>Third from</from>
<heading>Third heading</heading>
<body>Third body</body>
</note>
<note>
<to>Second to</to>
<from>second from</from>
<heading>second heading</heading>
<body>second body</body>
</note>
<note>
<to>first to</to>
<from>first from</from>
<heading>first heading</heading>
<body>first body</body>
</note>
</blog>
I am making a completely client side, but very simple bloging script. It uses JavaScript to parse the XML, then assign the values of it to HTML elements. I have this part working fine. I am now attempting to create a form button that changes the blog entry to the one lower down in the xml file (as in a previous entry). This will make more since if you look at the files. I used a for next loop, and everything looks fine to me, but of couse, it doesnt work. Please take a look and see if you can find a problem. The html is attached to this post, and the xml file is below (can't attach .xml to a post). Thanks.
The XML:
<?xml version="1.0" ?>
<blog>
<note>
<to>third to</to>
<from>Third from</from>
<heading>Third heading</heading>
<body>Third body</body>
</note>
<note>
<to>Second to</to>
<from>second from</from>
<heading>second heading</heading>
<body>second body</body>
</note>
<note>
<to>first to</to>
<from>first from</from>
<heading>first heading</heading>
<body>first body</body>
</note>
</blog>