sync javascript html5