Fix js syntax

fix javascript syntax according to jshint