-1

I want to open a .txt file on my maching using only jquery and then apppend a line to the END OF FILE and then save it.

Please tell me a solution . Or if it possible using jquery or not

  • 1
    Better and easier would be to use AJAX and then use file operations of any server side language like PHP etc – Varun Aug 10 '15 at 14:02
  • 1
    possible duplicate of [Read/write to file using jQuery](http://stackoverflow.com/questions/582268/read-write-to-file-using-jquery) – Artur Filipiak Aug 10 '15 at 14:05

1 Answers1

0

No, JavaScript doesn't have access to writing files as this would be a huge security risk to say the least. If you wanted to get/store information server-side, though, you can certainly make an Ajax call to a PHP/ASP/Python/etc. script that can then get/store the data in the server. If you meant store data on the client machine, this is impossible with JavaScript alone. I suspect Flash/Java may be able to, but I am not sure.

If you are only trying to store a small amount of information for an unreliable period of time regarding a specific user, I think you want cookies. I am not sure from your question what you are trying to accomplish, though.

From here

Community
  • 1
  • 1
Luca
  • 1,766
  • 3
  • 27
  • 38
  • If the question has been already answered on SO, instead of copy/paste you should mark it as "duplicate". – Artur Filipiak Aug 10 '15 at 14:06
  • i want to make an application using only jquery . which will not use database but would use a .txt file on which it will CRUD . The enitre app is to only use jquery and Html 5 – Rohitas Behera Aug 11 '15 at 14:38