简体   繁体   中英

Save context state in Noesis Javascript.net

I'm using the noesis javascript.net library in my C# MVC3 application.

Is it possible to save a snapshot of a javascript context object and then reload that snapshot into a new javascript context instance?

Not sure if the original user will find this useful but I achieved this by adding a object to my context that let me write to disk (simple wrapper around TextWriter), then serialized this where this was the global scope so it captured all objects. The obvious pitfall is that not all objects are serialized proper (I used JSON.stringify for serialization). When I need to reload the context I loaded up the string from the file into a variable in my context and set the objects back.

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