New version with javascript