added frontend javascript receive.js from demo branch