Javascipt Image gallery :)

Show off new creations, get help, or just chat about all aspects of web development and design.

Javascipt Image gallery :)

Postby pizzadox on Fri Sep 25, 2009 2:20 am xml file

My javascript, xml image gallery is near completion. Had some troubles getting it to run smoothly on IE but I got that fixed now (i think). :lol: The code is kinda messy, going to clean it when I'm done.
Any suggestions?
Joined: Wed May 13, 2009 3:54 am
Location: Canada

Re: Javascipt Image gallery :)

Postby zombie@computer on Fri Sep 25, 2009 8:18 am

It seems to work okay i guess. Looks clean, though layout isn't perfect imho.

1) You rely on javascript completely. Disable javascript and your galery is gone
2) You rely on httpxmlrequests. Esp in this case. Anyone capable of editing the xml file is also capable of editing the actual galery page's html, so that is no argument to use an xml next to the html galery. Serious users use php/mysql anyway, rendering it obsolete in its entirety.
3) innerHTML. Its considered bad practice. Use Document.createElement() instead to create your elements.
4) image size. Doesnt need to be in the xml:
Code: Select all
Image img = new Image();
img.src = myUrl
size = img.height || img.width

if you are just going to use the ratios this is all you need.

Well, you wanted suggestions, here ya go :)
When you are up to your neck in shit, keep your head up high
Forum Goer Elite™
Forum Goer Elite™
Joined: Fri Dec 31, 2004 5:58 pm
Location: Lent, Netherlands

Re: Javascipt Image gallery :)

Postby abathor on Fri Sep 25, 2009 7:45 pm

The best thing to do is get a working gallery with HTML and CSS alone, and then add javascript to enhance it. This way, you will have a great little page that doesn't rely on javascript and XHTML requests.
User avatar
1337 p0st3r
1337 p0st3r
Joined: Mon Dec 18, 2006 6:02 pm
Location: England

Re: Javascipt Image gallery :)

Postby RC-1290 on Fri Sep 25, 2009 8:13 pm

Although I strongly agree with the above two posts, I feel I should say I like it anyway :)
Where am I?
User avatar
1337 p0st3r
1337 p0st3r
Joined: Fri Sep 14, 2007 10:54 pm
Location: The Netherlands

Return to Web Design & Development

Who is online

Users browsing this forum: No registered users