added js demo code