updating js, adding demo

demo dosen't work unless run on a server