0

I have folder structure like the following

-> Parent folder
---> version_HTML (folder)
-----> index.html (file)

I would like to use an HTML file with javascript at the version_HTML level which will look for the file index.html in the subfolder and open it, as the folder name will keep varying.

The HTML file will be run from the local directory, and will not be hosted on the server or WWW.

I am open to alternative solutions too.

Any help is appreciated.

Deepak Rajendran
  • 358
  • 1
  • 11
  • You want to create a file from Javascript? are you using nodejs or some server-side javascript? – A. Matías Quezada Oct 08 '12 at 11:01
  • If its possible to embed the code inside the html file, it will be fine, else a .js file. I am a technical writer, and not a developer. So I have very limited understanding of how this works. Thank you for looking into this. – Deepak Rajendran Oct 08 '12 at 11:05

1 Answers1

0

As I understand you want to create a file on the server from a web page, it's not possible only with Javascript, and the way to do it is non trivial for a non developer.

The parent's name is not so much important since you can ask "create a file on my parent folder" but it has to be done by a server-side language, you can look at PHP, python or nodejs.

Also you'll need to send a AJAX request from Javascript to the server when you want the server to create this file. I insist, is not easy for a non-developer.

Community
  • 1
  • 1
A. Matías Quezada
  • 1,886
  • 17
  • 34
  • The html file will be run from the local directory, and will not be hosted on the www. Does it still involve such an elaborate process? – Deepak Rajendran Oct 08 '12 at 11:18
  • In this case is even harder, you cannot execute a AJAX request if the file is loaded locally and you have no server to ask for the operation. I can't see a way to do it. – A. Matías Quezada Oct 08 '12 at 11:22
  • I had created a batch file which performs this operation :@for /f "tokens=* delims= " %%a in ('@dir /ad /b') do @set FOLDER=%%a echo %FOLDER% start %FOLDER%\frames.html – Deepak Rajendran Oct 08 '12 at 11:24
  • Sorry, I've never used batch and have no Windows machine to test it. Maybe you can update the question. – A. Matías Quezada Oct 08 '12 at 11:31