If I loaded a js file in a <textarea> with a save button below it, can I save that to an existing js file on my server and then reload it. Basically, what I want to do would work just like a wysiwyg except I want to be able to save the js to an existing file.
I am loading the js file using document.write (“<script src='file.js'></script>“) which works.
BTW, this site would not let me put the ‘<‘ in the document write.
Short answer: Yes, but from your post I don’t think you’d find it easy.
In some more depth, you’ll need to use a server-side language such as PHP for this.
I won’t go into how to get set up with PHP, we’ll assume you know that, and if you don’t then you have a great excuse to go Googling 🙂 However, here’s a simple working example script for you.
WARNING: There are a lot of pitfalls with allowing people to write to files on your server. You CERTAINLY don’t want to make something like this accessible to anyone except HIGHLY trusted people. I can’t over-emphasise how careful you should be with something like this unless you understand the implications of it.