The quantization of the gravitational field is discussed within the exact uncertainty approach. The method may be described as a Hamilton-Jacobi quantization of gravity. It differs from previous approaches that take the classical Hamilton-Jacobi equation as their starting point in that it incorporates some new elements, in particular the use of a formalism of ensembles in configuration space and the postulate of an exact uncertainty relation. These provide the fundamental elements needed for the transition from the classical theory to the quantum theory.