HELP : Dynamically load a particular script file when required...

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

    HELP : Dynamically load a particular script file when required...

    Hi all,

    I have several folders of images. Inside each folder is a JS file defining
    an array of the images with a description of each image.

    When a user selects a 'gallery'/folder on my site, I want to be able to load
    in this JS file and create the HTML page of the images and descriptions.


    Before you say "use a database...", I can't due to the hosting company.
    Also, I want to make this simple for the users to update.!


    The other method I use at the minute is to have the HTML already created
    with the GALLERY.JS definded in the <HEAD> and just call that with a script
    to create the images, but that means each HTML page is the same except for
    the JS definition - which is just a waste - I want to do this dynamically.!

    example...

    Gallery 1 page...
    <html><head><ti tle></title>
    <link rel="stylesheet " type="text/css" href="../styles.css">
    <script language="JavaS cript" src="page1/gallery.js"></script>
    </head>
    ...

    Gallery 2 page...
    <html><head><ti tle></title>
    <link rel="stylesheet " type="text/css" href="../styles.css">
    <script language="JavaS cript" src="page2/gallery.js"></script>
    </head>
    ...

    I can't find away to call the
    <script language="JavaS cript" src="xxxxx/gallery.js"></script>
    line from within a script.




  • Mike Blackett

    #2
    Re: HELP : Dynamically load a particular script file when required...

    Fantastic.! Thanks matey

    Mike



    "Mosley Jones III" <me@info.gov.ma rs> wrote in message
    news:3f1f5132@f unnel.arach.net .au...[color=blue]
    >
    > "Mike Blackett" <me@mikeREMOVET HISblackett.co. uk> wrote in message
    > news:bfn4jv$58k $1@hercules.bti nternet.com...[color=green]
    > > Hi all,
    > >
    > > I have several folders of images. Inside each folder is a JS file[/color]
    > defining[color=green]
    > > an array of the images with a description of each image.
    > >
    > > When a user selects a 'gallery'/folder on my site, I want to be able to[/color]
    > load[color=green]
    > > in this JS file and create the HTML page of the images and descriptions.
    > >
    > >
    > > Before you say "use a database...", I can't due to the hosting company.
    > > Also, I want to make this simple for the users to update.!
    > >
    > >
    > > The other method I use at the minute is to have the HTML already created
    > > with the GALLERY.JS definded in the <HEAD> and just call that with a[/color]
    > script[color=green]
    > > to create the images, but that means each HTML page is the same except[/color][/color]
    for[color=blue][color=green]
    > > the JS definition - which is just a waste - I want to do this[/color]
    > dynamically.![color=green]
    > >
    > > example...
    > >
    > > Gallery 1 page...
    > > <html><head><ti tle></title>
    > > <link rel="stylesheet " type="text/css" href="../styles.css">
    > > <script language="JavaS cript" src="page1/gallery.js"></script>
    > > </head>
    > > ...[/color]
    >
    >
    > Somthing like this
    >
    > http://mosley.arach.net.au/lib/script.htm
    >
    > look at code
    >[color=green]
    > >
    > > Gallery 2 page...
    > > <html><head><ti tle></title>
    > > <link rel="stylesheet " type="text/css" href="../styles.css">
    > > <script language="JavaS cript" src="page2/gallery.js"></script>
    > > </head>
    > > ...
    > >
    > > I can't find away to call the
    > > <script language="JavaS cript" src="xxxxx/gallery.js"></script>
    > > line from within a script.
    > >
    > >
    > >
    > >[/color]
    >
    >[/color]


    Comment

    Working...