Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I am making a web application using javascript. I want to know
1) How can we create a new html file using javascript?
suppose I have a folder with locationexamples\new Files\. so I want that if some one click a button on my page then a javascript function runs and then creates a new html file in new Files folder with a specific text defined by the user.
Is there any way to do this or
Do i have to use different languages?
Javascript that is used in browsers, like jQuery, has no access to the filesystem. It is a security restriction, otherwise any tom dick or harry on the internet could seriously mess up your computer.
The only filesystem access allowed is Cookies.
If you want to achieve something like this, you will need something like node.js, although I have no experience with node.
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
I started using the python django framework. Can I open a dynamic site without using JavaScript? I find python easy to use and for some reason I don't like JavaScript.
In order to implement dynamic elements (such as displaying messages at button click without updating the site) you need to instruct the browser to change the respective DOM elements.
Currently the only fully supported language that browsers understand for that purpose is Javascript.
There are Javascript alternatives such as Dart or Typescript, but they need to be transpiled to Javascript to work with browsers.
So, practically you cannot build a dynamic website without Javascript at the moment.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
Plain js can be written and rendered in a html file, or in a js file and then included in the html. But with my Phaser.IO project, in order to get it to work I have to start a local web server. Why is this? Is it because of its referencing based of / of a typical www root?
Is it because of its referencing based of / of a typical www root?
That's likely, yes. If you open an HTML file locally, you're using the file: pseudo-scheme. If you then have a relative URL starting with a /, that's going to the root of your filesystem. (If you're on Windows, the only things [waves hands] at the root are drives like C:.)
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I need to do some image processing on a browser where I upload images and with my python script, it manipulates the images. In the end, I just want to open an HTML page where I can simply use buttons there to process my python script. Please tell me how can I do it? I don't know much about web development. I don't need to host a website. I just want to do it locally so that if I give my files to anyone they can access it by just opening the HTML document.
If you want to practice and you need to upload an image and processing in your web app you need to use Phyton(with Django should be more fast to create what you want) and MySQL(or another database) to save the data.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I have html file which do button operations on specific events.
When i tried to execute a shell script from html , I am not able to do the same.
Please help me to run shell script inside html.
Thanks
HTML does not have this capability.
(Nor, for that matter, does core JavaScript. Extensions from the host environment might provide that feature, but it would depend on the host environment. "A webpage with a <script> element" is a host environment that does not provide that functionality.)
You need to select a different technology. It could be one that outputs HTML though.
At first, this is not a simple "I have a problem, solve it for me!" site. But since it's SO's goal to educate, it would be wrong to push you away.
Let's start with your problem:
HTML can't do that, nor vanilla JavaScript. If the server with the files on it does support PHP and you have access to it in order to store a .php file on it, you can do it by using PHP:
$directory = "some/directory/you/want/to/display/";
$files = scandir($directory);
print_r($files);
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
How to browse the client machine's file system. Since it is not possible through c#, I've been trying through various resources like javascript and using activex control. Can someone help me in working out with how to get it done using either javascript or activex control.
Requirement:
My requirement is something like, when the client logs in, the code should be able to browse through the clients file system (drives, folders and subfolders) when he wants to navigate through. I need to display the file system in the form of treeview.
Thanks in advance.
Did you tried FileUpload Control? Hope so it will work for you to some extent.
Apart from this, no javascript or server side code can perform this action.