Better JS

Signed-off-by: Suki <suki@missallsunday.com>
Better idea, move this to setHeaders()

Signed-off-by: Suki <suki@missallsunday.com>
And apply the changes to template_display_profile() too

Signed-off-by: Suki <suki@missallsunday.com>