move error page js into script tag
Apply `var` keyword to js at welcome#index
Merge pull request #8723 from goshakkk/refactor-error-page

Move error page js into script tag
Merge pull request #8736 from tricknotes/apply-var

Apply `var` keyword to js at welcome#index
Don't use layout when requested from xhr