I assume you are using single page applications. You can change your server to be calm, and whenever something needs to be changed, your Javascript can update itself and report it.
Take a look at popular javascript frameworks, for example AngularJS, and see how single-page applications are developed. The first few tutorials should catch you.
No, you will not share variables directly. You will share what value contains your variables. When someone changes, you will inform your application about updating another.
, , , JSON.
{
"users": [
{
"firstName": "John",
"lastName": "Doe"
},
{
"firstName": "Anna",
"lastName": "Smith"
},
{
"firstName": "Peter",
"lastName": "Jones"
}
]
}
javascript. , (, ), , , .
, , AngularJS .