create document object on client side