0

I've been trying to get my head around this for a while, how do you remove a certain line from a TXT file using jQuery or JavaScript.

I understand you could use an AJAX method to process this server side, but is there a possibility of doing this in jQuery/JavaScript.

For example, say my text file "players.txt" has four lines:

Bob
Dave
Ethan
Sarah

When Ethan unloads the window, it should remove "Ethan" from the TXT file.

Thanks!

4

2 回答 2

2

JavaScript is a client-side programming language. and to read a file on the server you need a server-side programming language like: PHP, ASP.net, JSP, etc...

take a look at this question on web development StakExchange for more information.

于 2013-09-29T09:11:43.427 回答
1

No, you cannot perform file operations using JavaScript, as this would be a huge security risk

于 2013-09-29T09:07:42.223 回答