How to share context between windows.

1 view
Skip to first unread message

Ethan Lai

unread,
May 20, 2013, 2:23:12 AM5/20/13
to node-...@googlegroups.com
index.html + main.js
main.js:
var obj = {test: true};
global.obj = obj;

other.html:
console.log(global.obj);
//undefined

Is there any ways to get the obj?
Thanks. 

Nikola Jokic

unread,
May 20, 2013, 2:52:23 AM5/20/13
to node-...@googlegroups.com
Have you tried define obj as process.obj instead of global.obj?




2013/5/20 Ethan Lai <lain...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "node-webkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-webkit...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ethan Lai

unread,
May 20, 2013, 4:13:56 AM5/20/13
to node-...@googlegroups.com
I found if put the nw.exe file to project folder and run program, sometimes there will be some error.
Actually, the global object can share context.

在 2013年5月20日星期一UTC+8下午2时23分12秒,Ethan Lai写道:
Reply all
Reply to author
Forward
0 new messages