Javascript Read Content Directory

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Hannes

    Javascript Read Content Directory

    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
  • Thomas 'PointedEars' Lahn

    #2
    Re: Javascript Read Content Directory

    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:fe1a972 3-d180-4053-9651-c677a34c6ba3@l4 2g2000hsc.googl egroups.com>
    [2] <news:482AD1AF. 7080402@Pointed Ears.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

    Comment

    • Hannes

      #3
      Re: Javascript Read Content Directory

      On 14 mei, 21:04, Thomas 'PointedEars' Lahn <PointedE...@we b.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:fe1a972 3-d180-4053-9651-c677a34c6ba3@l4 2g2000hsc.googl egroups.com>
      [2] <news:482AD1AF. 7080402@Pointed Ears.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.

      Comment

      • Thomas 'PointedEars' Lahn

        #4
        Re: Javascript Read Content Directory

        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 bugRiddenCrashP ronePieceOfJunk = (
        navigator.userA gent.indexOf('M SIE 5') != -1
        && navigator.userA gent.indexOf('M ac') != -1
        ) // Plone, register_functi on.js:16

        Comment

        • Hannes

          #5
          Re: Javascript Read Content Directory

          On 14 mei, 23:09, Thomas 'PointedEars' Lahn <PointedE...@we b.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 bugRiddenCrashP ronePieceOfJunk = (
              navigator.userA gent.indexOf('M SIE 5') != -1
              && navigator.userA gent.indexOf('M ac') != -1
          )  // Plone, register_functi on.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.

          Comment

          • Thomas 'PointedEars' Lahn

            #6
            Re: Javascript Read Content Directory

            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.

            W3C's easy-to-use markup validation service, based on SGML and XML parsers.

            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>

            Comment

            Working...