By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,213 Members | 1,078 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,213 IT Pros & Developers. It's quick & easy.

Javascript Read Content Directory

P: n/a
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
Jun 27 '08 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Hannes wrote:
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] <news:fe**********************************@l42g200 0hsc.googlegroups.com>
[2] <news:48**************@PointedEars.de>
[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
Jun 27 '08 #2

P: n/a
On 14 mei, 21:04, Thomas 'PointedEars' Lahn <PointedE...@web.de>
wrote:
Hannes wrote:
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] <news:fe**********************************@l42g200 0hsc.googlegroups.com>
[2] <news:48**************@PointedEars.de>
[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.
Jun 27 '08 #3

P: n/a
Hannes wrote:
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
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16
Jun 27 '08 #4

P: n/a
On 14 mei, 23:09, Thomas 'PointedEars' Lahn <PointedE...@web.de>
wrote:
Hannes wrote:
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
--
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.

Jun 27 '08 #5

P: n/a
Hannes wrote:
[...] Thomas 'PointedEars' Lahn [...] wrote:
>Hannes wrote:
>>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
--
Use any version of Microsoft Frontpage to create your site.
(This won't prevent people from viewing your source, but no one
will want to steal it.)
-- from <http://www.vortex-webdesign.com/help/hidesource.htm>
Jun 27 '08 #6

This discussion thread is closed

Replies have been disabled for this discussion.