...

View Full Version : confused and frustrated



SilenceNMyHeart
12-09-2010, 04:03 AM
First let me say, I do know how to code I just haven't for a VERY long time and things are slow to come back. That being said, I'm working on a self induced project to bring back my coding abilities and I'm stuck. What I'm wanting to happen is when a certain link is clicked it goes to a certain photo album and pulls random pics just from that album and displays them in a certain place on that page. What would be the best way to approach this to make it happen?
I'm not wanting someone to do this for me, just get me going in the right direction.

Thanks....

jmrker
12-09-2010, 05:44 AM
Create the HTML template that the JS will act upon.
Once you have the placement and placeholders of the template, then use JS to accomplishe the actions.

Old Pedant
12-09-2010, 09:41 PM
I'm *guessing* that by "goes to a certain photo album" you mean that it accesses some directory on some server. And it simply looks in the directory to find what images are there.

If that's the case, you won't do it with JavaScript and HTML, alone, as JS/HTML does *NOT* have the ability to access the server's file system. Period. So you'll need some server-side code. PHP, ASP, ASP.NET, JSP, CF, cgi, etc.

jmrker
12-09-2010, 11:33 PM
I'm *guessing* that by "goes to a certain photo album" you mean that it accesses some directory on some server. And it simply looks in the directory to find what images are there.

If that's the case, you won't do it with JavaScript and HTML, alone, as JS/HTML does *NOT* have the ability to access the server's file system. Period. So you'll need some server-side code. PHP, ASP, ASP.NET, JSP, CF, cgi, etc.

I was assuming (bad on me) that the album would be a list of files pointing to the images on the directory. But you could be right ... guess we'll have to wait for the OP response. :eek:

SilenceNMyHeart
12-10-2010, 12:36 AM
Thanks, but I guess I should clarify. I already have the web site created, not uploaded as it is not finished. The design is good and "looks pretty" but I haven't made things work like I have envisioned. Hence the js grief. What I was wondering is if I use the onclick handler does it have to be in a function or form? This is where my memory leaves me. For example can I use it like this alone:

{function spiral(I won't put that code here because it's an embedded code
from where I created this spiral picture display in flash)
<input type = "button" value ="Stars and Stripes"
onclick="spiral"/>}

Anyway, I thought I would get this part to work before I ventured off into the random pic generator.

Thanks again

Old Pedant
12-10-2010, 12:42 AM
if I use the onclick handler does it have to be in a function or form?
No.



<input type="button" value="Go for it!" onclick="location.href='anotherPage.html';" />



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum