JavaScript SPA Single page application Syntax