Image Gallery, javascript and xml?

Associate
Joined
20 May 2007
Posts
441
Hey everyone

Im looking into making an image gallery in javascript (Use jQuery to add some nice effects) but I dont want the images to hardcoded, I was thinking of using an xml file to read in the number of albums and images and info accordingly to then generate the javascript gallery, but is this heading in a wrong direction?

I was just wondering if I could get someone elses input.

Many thanks
Matt
 
Associate
OP
Joined
20 May 2007
Posts
441
No particular reason for xml other than it seems to be able to do what i wanted which in xml would be expressed as:

Code:
<album>
    <title>Album 1</title>
    <direc>/images/gallery/000/</direc>
    <image>
        <filename>000.jpg</filename>
        <descrip>Image 000 descrip</descrip>
    </image>
    <image>
        <filename>001.jpg</filename>
        <descrip>Image 001 descrip</descrip>
    </image>
</album>

<album>
    <title>Album 2</title>
    <direc>/images/gallery/001/</direc>
    <image>
        <filename>000.jpg</filename>
        <descrip>Image 000 descrip</descrip>
    </image>
    <image>
        <filename>001.jpg</filename>
        <descrip>Image 001 descrip</descrip>
    </image>
</album>

And basically Im thinking of making this be updated not so much by manually adding in the xml file but storing this info in a database and then when ever the album is updated, it updates the database and then prints out a new xml file for the javascript file to use.

Im fairly new to server side programming, but Im just trying to think of the easiest way of achieving maintainability and flexibility and think this might be the right way.

Do you think JSON would be a much more suitable way to go?

Anyone see any holes in my plan? The more input the better

Cheers,
Matt
 
Back
Top Bottom