Say, would anyone know if it would be possible or easy to serialize a JavaScript runtime environment or context into a string, to save state as to all the data in that environment? I don't fully understand how the "compile" option works so I can't say if that is comparable.
What I am thinking is, my project would like to be able to run scripts in the browser when the browser is compatible with the JS requirements, and run them on the server otherwise. Doing this rises a ton of technical challenges that I am addressing, but among them is the fact that the JS on client is stateful. When you click something to interact with it, the JS handles the request, and the state of the web page and of all the JS data remains intact awaiting your next request. If you try emulating this server side however, the server first serves you the page (and emulates whatever JS initialization there is) and then sends you the page state at that point. If I could serialize the JS context at this point and store it, then after the user clicks to interact with something I could retrieve the serial and restore it as a context in order to continue servicing the request. A restored context would remember all of the JS information, and in my workflow the page state is stored as a dom or e4x object so that is saved as well. Is that something that "compile" already does by chance, or if not is there any other functionality that could accomplish it? Thanks for your consideration. :) - - Jesse Thompson Webformix
