Javascript for fetching and displaying jpgs ???

V

VivekR

Hi All

Please help me out with this thing in javascript. I am dumb in the
world of JS/Html/...

I have a url, say www.someurl.com. It has a list of jpgs that can
accessed as www.something.com/one.jpg or www..../two.jpg etc. Now i
need to get the list of the jpgs and then display it on a web page one
by one, triggered by a timer. I have to do this using javascript.

Please help me in doing it.

Thanks
 
Y

Yanick

VivekR said:
Hi All

Please help me out with this thing in javascript. I am dumb in the
world of JS/Html/...

I have a url, say www.someurl.com. It has a list of jpgs that can
accessed as www.something.com/one.jpg or www..../two.jpg etc. Now i
need to get the list of the jpgs and then display it on a web page one
by one, triggered by a timer. I have to do this using javascript.

Please help me in doing it.

Thanks

I don't know if that is what you wanted, but this is a start..

// this will build an array with all images with a .jpg extension
var allJPGs = [];
for (var i=0; i<document.images.length; i++){
if ( document.images.src.match( /\.jpg$/i ) ) {
allJPGs.push( document.images.src );
}
}
 

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
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top