Communication between server & javascript