Function serializePage