Reputation: 7
I am writing a website and I have a very basic understanding of JavaScript (JS) but a good understanding of HTML and CSS. I want to have an admin part of the website were you can edit the content of the site. I also need help on how to display these text files onto the website using JS. Thank you for your help.
Upvotes: 0
Views: 960
Reputation: 2511
In HTML5 you can operate on local files via the File API (have a look at http://www.html5rocks.com/en/tutorials/file/dndfiles/ for a quick tutorial) but manipulating files on the server using JavaScript on its own is impossible. You need to use AJAX to send a request to a PHP (or some other server-side language) script to do it for you.
Upvotes: 0
Reputation: 15812
You can do it with ActiveX objects - http://www.yaldex.com/wjscript/jsfilecreateTextFile.htm - but you're tying yourself to proprietary IE support.
Other than that, you'll need a server-side language such as PHP.
Upvotes: 0
Reputation: 633
No. You can't. For this you will need backend server software, like PHP.
Upvotes: 1