jquery - Cross tab variable in javascript without server interaction -
i developing chat system , got question ask you.
i dont think possible since see similar behaviour in websites, know how access variable defined/modified in other tab? mean don't want send server. how
var myvalue=getvalueinavailabletab(varname);
if not possible, how facebook know if chat dialog has been closed in tab? post event on server , retrieve it?
i sorry not stealing behaviours best example explain want do.
in circumstances, answer question cannot access javascript variable in tab. there other ways pass data between tabs, however:
- you may create browser extension has functionality want. though different browser frameworks have different limitations upon accessing code of pages open.
- if windows guaranteed opened same parent window, may use
window.parent
orwindow.opener
- if both tabs same origin site, may have 1 tab store value in cookie, , have other tab retrieve value.
these ways in may accomplish need without server interaction. i'm not sure method facebook uses, however.
Comments
Post a Comment