Added JS code and test page