Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

asp variable on a javascript

Status
Not open for further replies.

aarellano

MIS
Oct 22, 2007
168
US
I came across a javascript that shows pictures. I was wondering if there is a way to make the pictures a variable so that the user can just drop the pictures on a folder and tey are shown
this is the part of the javascript where it has the pics
Code:
var JaS = {
	// Customization parameters
	imagePath : "pictures/",
	images : [
		["1.jpg", ,],
		["2.jpg", ,],
		["3.jpg", ,],
		["4.jpg", ,],
		["5.jpg", ,],
		["6.jpg", ,],
		["7.jpg", ,], // Separate multiple tags by a comma
		["8.jpg", ,]
	],

Any help or pointing me to the right direction would really help.

Thanks!!

 
I suspect this question may be better addressed in forum216

------------------------------------------------------------------------------------------------------------------------
"As for the bureacratic, politically-correct, mollycoddling, asinine, Romper Room antics of...clients and management, just read up on Dilbert. It's not funny - it's a training manual."
- Mike
 
Yes, there's a way in ASP to do this. Use the File Scripting Object to read the directory and sort out the image files, then write the Javascript out as you wish for them to display.

Lee
 
trollacious

I wish I could understand that but it is a bit over my knowledge. do you have any sites where I could see some samples so I can get an idea on how to go about this?
 
Which bit is not clear? In your ASP sort out the files you want to show. Then generate the javascript on the fly using response.write to include your variables:
Code:
    response.write("images : [")
response.write("[" & chr(34) & myfirstpicturename & chr(34) &", ,],")
etc.

___________________________________________________________
If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
Steam Engine Prints
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top