简体   繁体   中英

Is there a way to serialize a string in java script?

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?

Serialization, usually converts an object into a text format, ie Json which then allows you to rebuild the text into an object.

In javascript, you can do this with Json, however storing it in a file would have to be done by server side coding, ie via an Ajax request.

Yes there is!

Serialize data

From there you can store it, pass it etc..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM