porting demo using js file from github directly