Move error page js into script tag