A simple variational wavefunction is proposed for calculating the energy of nodeless quantum states of a hydrogenic donor located at the centre of a spherical GaAs (Ga,Al)As quantum dot. Energies are calculated for the 1s, 2p and 3d states for a range of values of the radius of the quantum dot. The results are compared to the ''exact'' energies and for the ground state with the results obtained by using the wavefunction proposed by Porras-Montenegro and Perez-Merchancano [Phys. Rev. B 46 (1992) 9780]. For the range of quantum dot radii of practical interest, it is shown that the proposed wavefunction gives results of good accuracy. For the ground state, the results from the proposed wavefunction for R =< 4 are considerably better than those obtained from the wavefunction used by Porras-Montenegro and Perez-Merchancano.