0

I am new to javascript. I want to store the value of a string in a file. I am able to store the string in a normal text file. But what i need is I want to serialize the data and then store it in a file so that no one can edit it.

Like what we do in java (serialization concept in java).

Can anyone help me in how to serialize a string using javascript?

4

2 回答 2

0

序列化,通常将对象转换为文本格式,即 Json,然后允许您将文本重新构建为对象。

在 javascript 中,您可以使用 Json 执行此操作,但是将其存储在文件中必须通过服务器端编码完成,即通过 Ajax 请求。

于 2012-07-20T10:59:54.123 回答
0

就在这里!

序列化数据

从那里你可以存储它,传递它等等。

于 2012-07-20T11:00:03.673 回答