Javascript Read Content Directory

H

Hannes

Hi,

How can I read the Content of a directory in my HTML-structure, and
show it with an alertbox or something.

What I actually want, a Photo-Page.

If i load the page,
My browser have to check how many directories there are in the map
ALBUMS. So if i add an album later I don't have to adjust my code.
Present those as links on my page. And if I hit one of those links. It
has to show the pictures in that specific album. Design is for later.

So this would be my structure
index.htm
photo.htm
- DIR: ALBUMS
- SUBDIR: ALBUM1
- photo1.jpg
- photo2.jpg
- picture.jpg
- SUBDIR: ALBUM2
- .....

And so on
So if I add an album or a picture in one of the albums I just want to
upload my directories with CuteFTP, and not change any code.

Greetings
Hannes
 
T

Thomas 'PointedEars' Lahn

Hannes said:
How can I read the Content of a directory in my HTML-structure, and
show it with an alertbox or something.
[...]
So if I add an album or a picture in one of the albums I just want to
upload my directories with CuteFTP, and not change any code.

Asking the same question[1] all over again is not going to result in better
answers. The same good answer[2] remains: you also need a server-side
application for this; maybe, but probably better not, written in "JavaScript".

Client-side JavaScript alone cannot do this as it cannot "know" about the
server-side directory structure without the server "telling" it about it.

You have already been asked to learn the basics and you have been pointed to
the newsgroup where general Web authoring questions are on-topic. Further
disregard of that request is considered impolite and therefore may result in
your postings being filtered out by individual subscribers. You have been
warned.[3]

[1] <[2] <[3] <http://jibbering.com/faq/>


PointedEars
 
H

Hannes

Hannes said:
How can I read the Content of a directory in my HTML-structure, and
show it with an alertbox or something.
[...]
So if I add an album or a picture in one of the albums I just want to
upload my directories with CuteFTP, and not change any code.

Asking the same question[1] all over again is not going to result in better
answers.  The same good answer[2] remains: you also need a server-side
application for this; maybe, but probably better not, written in "JavaScript".

Client-side JavaScript alone cannot do this as it cannot "know" about the
server-side directory structure without the server "telling" it about it.

You have already been asked to learn the basics and you have been pointed to
the newsgroup where general Web authoring questions are on-topic.  Further
disregard of that request is considered impolite and therefore may result in
your postings being filtered out by individual subscribers.  You have been
warned.[3]

[1] <[2] <[3] <http://jibbering.com/faq/>

PointedEars
--
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee

I maybe explained the thing about Client wrong.
I just mean my customer has to be able to just upload his directory
structure with albums with FTP. So he can easily adjust his website.
There is no server involved in this.
 
T

Thomas 'PointedEars' Lahn

Hannes said:
I just mean my customer has to be able to just upload his directory
structure with albums with FTP. So he can easily adjust his website.
^^^ ^^^^^^^
There is no server involved in this.

At least an FTP and an HTTP server is involved in this, of course.


Score adjusted

PointedEars
 
H

Hannes

                             ^^^                             ^^^^^^^


At least an FTP and an HTTP server is involved in this, of course.

Score adjusted

PointedEars
--
var bugRiddenCrashPronePieceOfJunk = (
    navigator.userAgent.indexOf('MSIE 5') != -1
    && navigator.userAgent.indexOf('Mac') != -1
)  // Plone, register_function.js:16

But for example i have the following simple code,

<img src="knopfler/knopfler.jpg" />
<img src="knopfler/knopfler1.jpg" />
<img src="knopfler1/knopfler2.jpg" />
<img src="knopfler1/knopfler3.jpg" />
<img src="knopfler2/knopfler4.jpg" />
<img src="knopfler2/knopfler5.jpg" />
<img src="knopfler2/knopfler6.jpg" />
<img src="knopfler3/knopfler7.jpg" />

This is manual code. But is there no way I can let this to do by
javascript.
I can't use something else, my webspace does not support this.
 
T

Thomas 'PointedEars' Lahn

Hannes said:
Hannes said:
I just mean my customer has to be able to just upload his directory
structure with albums with FTP. So he can easily adjust his website.
^^^ ^^^^^^^
There is no server involved in this.
At least an FTP and an HTTP server is involved in this, of course.
[...]

But for example i have the following simple code,

<img src="knopfler/knopfler.jpg" />
<img src="knopfler/knopfler1.jpg" />
<img src="knopfler1/knopfler2.jpg" />
[...]

The trailing `/' does not belong there unless its XHTML (and you do not want
that), and the required `alt' attribute is missing.

http://validator.w3.org/
This is manual code. But is there no way I can let this to do by
javascript.

Well, if your Web server provided a directory listing you could parse this,
and generate the `img' elements dynamically. But then nothing worked
without client-side script support, so you really do not want that.
I can't use something else, my webspace does not support this.

Get better webspace, then.

And please trim your quotes as described e.g. in the FAQ Notes.


PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,141
Messages
2,570,818
Members
47,367
Latest member
mahdiharooniir

Latest Threads

Top