On Sep 20, 2007, at 10:06 AM, Scott Sauyet wrote:

Mr Batman wrote:
I would like to insert all of the images from a certain folder in the
root of my site into one div on my home page automatically.
Is this possible with jQuery and if so how do you do it?

jQuery cannot know what files are on your server. If you have some server-side solution to list them all in a format that JQuery can read then it would be pretty straightforward. That format could be XML, JSON, HTML, even plain text. Do you have the ability on the server to create such a list? You could do it with PHP, ColdFusion, Java, ASP, or numerous other tools, even manually creating a list if it's fairly static.

  -- Scott



I might be misunderstanding what is going on here, but I thought Jake Wolpert put together a plugin that does just that:

http://jqueryjs.googlecode.com/svn/trunk/plugins/traverseDir/jquery- traverseDir.js

Here are the opening comments from that plugin:

/**
* traverseDir/addDir , add content from a directory on an apache server. And a some support routines. * @example $("#footer").addDir({dir:"Pix/tiny/",height: 30,randomize:true})
 * @desc  add a randomized set of pictures to the footer
 * @param hash of the directory and the options to build the html.
 * @type jQuery
 *
 * @name addDir

 * @example     $("#footer").traverseDir({urlHandler:callback})
* @desc add a randomized set of pictures to the footer, with a custom callback
 * @param hash of the directory and the options to build the html.
 * @type jQuery
 *
 * @name traverseDir

* @example var hash = $.traverseDir({types: 'jpe?g|gif| png' ,dir:"flags/"})
 * @desc  add a randomized set of pictures to the footer
 * @param hash of the directory and the options to build the html.
 * @type hash
 *
 * @name traverseDir

 * @cat Directory Reading
 * @author Jake Wolpert ([EMAIL PROTECTED])
 */

By the way, anyone know whatever happened to Jake? Haven't heard from him on this list in a long time.

--Karl
_________________
Karl Swedberg
www.englishrules.com
www.learningjquery.com




Reply via email to