move error page js into script tag
Merge pull request #8723 from goshakkk/refactor-error-page

Move error page js into script tag