开发者

Create and Write to Files with JavaScript/JQuery

A few days ago I started to build a "Talk To Us Page" In c#.

So, I did a few buttons and text arena options..

And it was easy as C# should be. You just use a system IO or any thing and write to files..

I tried to do some thing very similarly with JS\jQuery and had no idea how to do so.

I looked around google a bit, and found nothing. Really, found about 30 people who are saying things that are really not working.

And I have to do is write a few lines of text from textbox..

The textboxes look like this:

<input 开发者_JS百科type="text" name="">

<input type="text" name="">

and when you clicked of a button it will write it all down to a file in driver c, or anything like that.

I really thinks its not that hard, but I need a hand.

Please help me. thanks!


and when you clicked of a button it will write it all down to a file in driver c, or anything like that.

Forget about it. For security reasons javascript that runs in a browser has no access to client and server files. Just think of the consequences if this was possible. You visit some site on the internet and all of a sudden files start to popup up and out of existence from your hard drive. Definitely something that should be forbidden.


Outside of Internet Explorer, you cannot use JavaScript to write to the local file system. This is a security feature of the sandbox in which in-browser JS runs.


javascript cant access the files contents, atleat on the client machine.

here is a helpful link http://en.wikipedia.org/wiki/JavaScript#Security

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜