•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 423,579 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,410 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 849 | Replies: 4
![]() |
Hi. I need some help with arrays in JavaScript. I am creating a slideshow and have to store the images in an array on a separate file. I need some feedback as far as am I missing something in this file and how can I then call this array into my slideshow file? So far, I have:
<script type="text/javascript"> // Create an array to hold image filenames var images = new Array(); // Populate array with image filenames imgname[0] = 'home.jpg'; imgname[1] = 'beach.jpg'; imgname[2] = 'pool.jpg'; imgname[3] = 'garden.jpg'; imgname[4] = 'pond.jpg'; imgname[5] = 'car.jpg'; </script>
•
•
Join Date: Mar 2008
Location: Madrid - Spain
Posts: 20
Reputation:
Rep Power: 1
Solved Threads: 3
You create a new array
and then you want to reference
..hmmm! names do not match.
Also, creating a new array, does not create a new array if images... you may want to create the elements of the array as:
var images = new Array();
and then you want to reference
imgname[0] = 'home.jpg'; ...
..hmmm! names do not match.
Also, creating a new array, does not create a new array if images... you may want to create the elements of the array as:
images[0] = new image(); image[0].src = 'home.jpg'; ...
You keep going, have a Nice day!
Henry.
Before printing this message, make sure is necessary.
Henry.
Before printing this message, make sure is necessary.
![]() |
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: How do I identify what type and where my code is in the HTML DOM tree?
- Next Thread: AJAX DIV Refresh Help....



Linear Mode