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

M

Mike Blackett

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><title></title>
<link rel="stylesheet" type="text/css" href="../styles.css">
<script language="JavaScript" src="page1/gallery.js"></script>
</head>
...

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

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

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,008
Messages
2,570,268
Members
46,867
Latest member
Lonny Petersen

Latest Threads

Top