a demo fully based on javascript