admin管理员组文章数量:1302937
I would like to serialize an instance of JS object from the Server-side to the Client side (the object contains data members and functions)
I have a Javascript stack on both end, all my users use Chrome and My server side is a NodeJS impl..
how would I do it? It should be trivial as my server is a Javascript one..
I would like to serialize an instance of JS object from the Server-side to the Client side (the object contains data members and functions)
I have a Javascript stack on both end, all my users use Chrome and My server side is a NodeJS impl..
how would I do it? It should be trivial as my server is a Javascript one..
Share edited Aug 2, 2010 at 17:00 Robert Harvey 181k48 gold badges348 silver badges513 bronze badges asked Aug 1, 2010 at 9:39 user407854user4078541 Answer
Reset to default 9You could send it as JSON string. Here's an example:
response.writeHead(200, {'Content-Type': 'application/json'});
response.write(JSON.stringify(yourObject));
response.close();
本文标签: Serialization of Javascript from Server(NodeJS) to BrowserStack Overflow
版权声明:本文标题:Serialization of Javascript from Server(NodeJS) to Browser - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741660791a2391022.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论