Help changing page contents

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

    Help changing page contents

    Can anyone please help me with this I'm a total newbie and just getting
    started in JS.

    I have a page where I would like to display a picture and a short textual
    explanation of the picture. I have several pictures that I would like to
    display all linking from a previous page. At present what I'm doing is
    linking each thumbnail to an individual html page showing the larger image
    with the text. It struck me that as the rest of the page is the same and
    only the large image and text change for each thumbnail cann I not have a
    single page and pass parameters indicating which image and text to use. I
    know it sounds like I'm asking you to write my code for me but any help
    would be appreciated.

    Cheers

    JJM


  • David Dorward

    #2
    Re: Help changing page contents

    JJM wrote:
    [color=blue]
    > I have a page where I would like to display a picture and a short textual
    > explanation of the picture. I have several pictures that I would like to
    > display all linking from a previous page. At present what I'm doing is
    > linking each thumbnail to an individual html page showing the larger image
    > with the text. It struck me that as the rest of the page is the same and
    > only the large image and text change for each thumbnail cann I not have a
    > single page and pass parameters indicating which image and text to use[/color]

    While it is /possible/ to do this using JavaScript, it is not a good idea.
    Client side scripting is excellent for enhancing content, but not reliable
    enough to depend on to /generate/ content (well, unless you don't care
    about 10%[1] of your visitors including search engine indexing robots).

    This is more a job for a server side process such as CGI (with Perl, Python,
    Ruby, or another language handling the HTML generation), mod_perl, PHP, ASP
    (with VBScript, PerlScript or JScript), JSP, etc.

    You can form your URL along the lines:

    or, with some trickery


    Then you can read the variables back in the script and stick them in
    placeholders in the document.

    Going a stage further, you could store the data in a database on the server,
    and then provide much shorter (and cleaner) URLs.

    http://www.devshed.com/ is a reasonable place to start learning about server
    side programming.

    [1] Usual warnings about statistics apply

    --
    David Dorward http://david.us-lot.org/

    Comment

    • Jeff North

      #3
      Re: Help changing page contents

      On Sat, 19 Jul 2003 23:26:16 +0100, in comp.lang.javas cript "JJM"
      <johnmartin@cla ra.net> wrote:
      [color=blue]
      >| Can anyone please help me with this I'm a total newbie and just getting
      >| started in JS.
      >|
      >| I have a page where I would like to display a picture and a short textual
      >| explanation of the picture. I have several pictures that I would like to
      >| display all linking from a previous page. At present what I'm doing is
      >| linking each thumbnail to an individual html page showing the larger image
      >| with the text. It struck me that as the rest of the page is the same and
      >| only the large image and text change for each thumbnail cann I not have a
      >| single page and pass parameters indicating which image and text to use. I
      >| know it sounds like I'm asking you to write my code for me but any help
      >| would be appreciated.[/color]

      To do this you would need to use server-side scripting (ASP, Perl, PHP
      etc).

      Find out what your web host uses. I have an ASP/VBScript script
      (borrowed from elsewhere :-) of course) that will open a window to the
      size of the selected image. If your text is only one or two lines then
      the window size can easily be re-adjusted.
      ---------------------------------------------------------------
      jnorth@yourpant sbigpond.net.au : Remove your pants to reply
      ---------------------------------------------------------------

      Comment

      • JJM

        #4
        Re: Help changing page contents

        Thanks guys. I'm going to look at server side stuff to do this. I've just
        changed my hosting company to one that will allow me to upload my own
        scripts and let me host a mySQL database.

        JJ


        Comment

        Working...