Format string with javascript.