JavaScript - Need Help With Directories...
Okay, right now I'm working on a photo veiwer (YES, i know theres alotta those on here) but none of them that i've found do what I'm looking for. The application itself is on the users computer saved as an html file. It has to be for what I need. See, what I want to do is ONE of TWO possibilities:
1. The user can enter the name of the pic including extension, and it gets it from the directory. ( the directory is on the users comp as well. ) OR 2. It could read the names of all the files in the directory and display them in a list. I know JS is Client-Side, but does that mean too that it cant acess a dir on the users comp when the script itself is even on the users comp as well? I just want to clarify for myself that this isn't an option. This is the code I currently have, but the picture when I go to use it doesn't show. Code: <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Photo Browser</title> <script type="text/javascript"> function VeiwPic() { twrite = prompt("Enter the name of image file, including extension\n(.jpg, .gif, etc..)",''); if (twrite != "" && twrite != null){ twrite = '"' + twrite + '"'; document.write('<img src="PICTURE/' + twrite + '">'); } } </script> </head> <body> <center> <input type="button" value="Click here to search" onclick="VeiwPic()"> </center> </body> </html> Already tried adding html and body tags into document.write, doesn't make a difference. ALSO, I forgot to mention that I CAN NOT use Active X AT ALL. The system I'm using does not support Active X control, it just does nothing. Pretty weak if you ask me but theres nothin I can do about it. Any advice on how i would go about getting this to work would be greatly appreciated. Thanks in advance! Similar TutorialsWhat's the javascript syntax for changing directories? I'm trying to do this... onChange="javascript:../../showmodels(this.value)" ...but that doesn't work. onChange="javascript:showmodels(this.value)" ...Works fine, but only when called in the main directory and it might be called from subdirectory. Any idea where I'm going wrong? Thanks |