Demo of Qiaoyuan's JavaScript code