473,549 Members | 5,214 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Javascript: Get a list of photos

67 New Member
Ok I want to create an array of photos that are in a specific directory of the web server is their a way to get the list of files and store it into an array? thanks

i tried

Expand|Select|Wrap|Line Numbers
  1. var pictureID;
  3. document.onload
  4. {
  6.     pictureID = 0;
  7.     var pictures = new Array("balls.jpg", "kids.jpg", "kids2.jpg" )
  8.     document.write("hi");
  9.     document[thispicture].src = "test";
  10.         document.write("hi");
  12. }
but it wouldnt allow me to change the src of the thispicture img tag
May 3 '09 #1
1 1627
16,027 Recognized Expert Moderator MVP
For your original query, the answer is: not with JavaScript. Use your server-side language, e.g. PHP, ASP, etc.

In your code, change line 3 to
Expand|Select|Wrap|Line Numbers
  1. window.onload = function()
Is thispicture a variable? If not, and the name of the image is thispicture, you can use
Expand|Select|Wrap|Line Numbers
  1. document.images["thispicture"].src = ...
You also need to use a valid image file name/path.
May 3 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

by: Sue Barth | last post by:
Hi all, I hope I'm in the right ng for this... I made an .asp page that allows users to toggle thru a directory of photos. The page accomplishes the following: selects a directory of photos based on a drop down uses the fso to obtain the # of photos in the directory cycles thru the photos w forward and backward buttons that send the pic #...
by: John Ortt | last post by:
Hi Everyone, I have created a Javascript menu for my site which uses frames. The first stage loads fine but I want two drill down menus ("About Me Menu" and "Projects Menu"). The pages load fine, but the images aren't displayed, instead the alt text is shown. The images come up after you "Mouse Over" them but not before......can anybody...
by: Gary | last post by:
I do a lot of hacking when I program. I don't know javascript but have hacked code to use on my noncommercial web pages. Right now I have two problems, one I need to solve and one that I would like to solve. I am trying to create something to display photos that I took in Belize. The first page shows a map of an archeological site and...
by: Rajesh Rao | last post by:
Hi guys, following url works in Fire Fox but not On IE. http://www.dell.com/content/topics/topic.aspx/global/hybrid/snp/en/storage_type?c=us&cs=19&l=en&ModelSelection=121317&s=dhs
by: mr.mattyg | last post by:
I might as well start off like everyone else who posts problems they are having....So I'm new to JavaScript..... Anywho, I have a page that lists 15 or so thumbnails and then one big image of one of those thumbnails. I wrote some javascript code that when you click on the thumbnail the real picture of that thumbnail loads in the big image...
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.