format js and document